Lines Matching defs:VMap

40                                   ValueToValueMapTy &VMap,
55 VMap[&*II] = NewInst; // Add instruction map to value.
76 // VMap values.
79 ValueToValueMapTy &VMap,
89 assert(VMap.count(&I) && "No mapping from source argument specified!");
101 MapValue(OldFunc->getPersonalityFn(), VMap,
106 // Clone any argument attributes that are present in the VMap.
108 if (Argument *NewArg = dyn_cast<Argument>(VMap[&OldArg])) {
131 BasicBlock *CBB = CloneBasicBlock(&BB, VMap, NameSuffix, NewFunc, CodeInfo);
134 VMap[&BB] = CBB;
145 VMap[OldBBAddr] = BlockAddress::get(NewFunc, CBB);
154 // references as we go. This uses VMap to do all the hard work.
156 cast<BasicBlock>(VMap[&OldFunc->front()])->getIterator(),
161 RemapInstruction(&II, VMap,
191 ValueToValueMapTy &VMap) {
199 cast<DISubprogram>(MapMetadata(OldSubprogramMDNode, VMap));
217 /// in the VMap are changed to refer to their mapped value instead of the
218 /// original one. If any of the arguments to the function are in the VMap,
219 /// the arguments are deleted from the resultant function. The VMap is
223 Function *llvm::CloneFunction(const Function *F, ValueToValueMapTy &VMap,
229 // the VMap. If so, we need to not add the arguments to the arg ty vector
232 if (VMap.count(&I) == 0) // Haven't mapped the argument to anything yet?
245 if (VMap.count(&I) == 0) { // Is this argument preserved?
247 VMap[&I] = &*DestI++; // Add mapping to VMap
251 CloneDebugInfoMetadata(NewF, F, VMap);
254 CloneFunctionInto(NewF, F, VMap, ModuleLevelChanges, Returns, "", CodeInfo);
265 ValueToValueMapTy &VMap;
278 : NewFunc(newFunc), OldFunc(oldFunc), VMap(valueMap),
304 WeakVH &BBEntry = VMap[BB];
326 VMap[OldBBAddr] = BlockAddress::get(NewFunc, NewBB);
338 Director->handleInstruction(VMap, &*II, NewBB);
358 RemapInstruction(NewInst, VMap,
369 if (Value *MappedV = VMap.lookup(V))
372 VMap[&*II] = V;
380 VMap[&*II] = NewInst; // Add instruction map to value.
402 = Director->handleInstruction(VMap, OldTI, NewBB);
426 Value *V = VMap[BI->getCondition()];
433 VMap[OldTI] = BranchInst::Create(Dest, NewBB);
442 Value *V = VMap[SI->getCondition()];
448 VMap[OldTI] = BranchInst::Create(Dest, NewBB);
459 VMap[OldTI] = NewInst; // Add instruction map to value.
485 ValueToValueMapTy &VMap,
506 assert(VMap.count(&II) && "No mapping from source argument specified!");
509 PruningFunctionCloner PFC(NewFunc, OldFunc, VMap, ModuleLevelChanges,
535 Value *V = VMap[&BI];
548 if (isa<PHINode>(VMap[PN]))
559 RemapInstruction(NewBB->getTerminator(), VMap,
570 BasicBlock *NewBB = cast<BasicBlock>(VMap[OldBB]);
577 PHINode *PN = cast<PHINode>(VMap[OPN]);
579 Value *V = VMap[PN->getIncomingBlock(pred)];
582 VMap,
637 assert(VMap[&*OldI] == PN && "VMap mismatch");
638 VMap[&*OldI] = NV;
648 // WeakVH in the VMap. Notably, we rely on that so that if we coalesce
653 if (PHINode *PN = dyn_cast<PHINode>(VMap[PHIToResolve[Idx]]))
660 Function::iterator Begin = cast<BasicBlock>(VMap[StartingBB])->getIterator();
711 for (Function::iterator I = cast<BasicBlock>(VMap[StartingBB])->getIterator(),
727 ValueToValueMapTy &VMap,
733 CloneAndPruneIntoFromInst(NewFunc, OldFunc, &OldFunc->front().front(), VMap,
738 /// \brief Remaps instructions in \p Blocks using the mapping in \p VMap.
740 const SmallVectorImpl<BasicBlock *> &Blocks, ValueToValueMapTy &VMap) {
744 RemapInstruction(&Inst, VMap,
754 Loop *OrigLoop, ValueToValueMapTy &VMap,
769 BasicBlock *NewPH = CloneBasicBlock(OrigPH, VMap, NameSuffix, F);
771 VMap[OrigPH] = NewPH;
782 BasicBlock *NewBB = CloneBasicBlock(BB, VMap, NameSuffix, F);
783 VMap[BB] = NewBB;
790 DT->addNewBlock(NewBB, cast<BasicBlock>(VMap[IDomBB]));