Lines Matching refs:VMap

38                                   ValueToValueMapTy &VMap,
53 VMap[II] = NewInst; // Add instruction map to value.
74 // VMap values.
77 ValueToValueMapTy &VMap,
87 assert(VMap.count(I) && "No mapping from source argument specified!");
94 //Some arguments were deleted with the VMap. Copy arguments one by one
97 if (Argument* Anew = dyn_cast<Argument>(VMap[I]))
118 BasicBlock *CBB = CloneBasicBlock(&BB, VMap, NameSuffix, NewFunc, CodeInfo);
121 VMap[&BB] = CBB;
132 VMap[OldBBAddr] = BlockAddress::get(NewFunc, CBB);
141 // references as we go. This uses VMap to do all the hard work.
142 for (Function::iterator BB = cast<BasicBlock>(VMap[OldFunc->begin()]),
146 RemapInstruction(II, VMap,
153 /// in the VMap are changed to refer to their mapped value instead of the
154 /// original one. If any of the arguments to the function are in the VMap,
155 /// the arguments are deleted from the resultant function. The VMap is
159 Function *llvm::CloneFunction(const Function *F, ValueToValueMapTy &VMap,
165 // the VMap. If so, we need to not add the arguments to the arg ty vector
169 if (VMap.count(I) == 0) // Haven't mapped the argument to anything yet?
183 if (VMap.count(I) == 0) { // Is this argument preserved?
185 VMap[I] = DestI++; // Add mapping to VMap
189 CloneFunctionInto(NewF, F, VMap, ModuleLevelChanges, Returns, "", CodeInfo);
201 ValueToValueMapTy &VMap;
214 VMap(valueMap), ModuleLevelChanges(moduleLevelChanges),
229 WeakVH &BBEntry = VMap[BB];
251 VMap[OldBBAddr] = BlockAddress::get(NewFunc, NewBB);
266 RemapInstruction(NewInst, VMap,
275 if (Value *MappedV = VMap.lookup(V))
278 VMap[II] = V;
286 VMap[II] = NewInst; // Add instruction map to value.
306 Value *V = VMap[BI->getCondition()];
313 VMap[OldTI] = BranchInst::Create(Dest, NewBB);
322 Value *V = VMap[SI->getCondition()];
328 VMap[OldTI] = BranchInst::Create(Dest, NewBB);
339 VMap[OldTI] = NewInst; // Add instruction map to value.
363 ValueToValueMapTy &VMap,
375 assert(VMap.count(II) && "No mapping from source argument specified!");
378 PruningFunctionCloner PFC(NewFunc, OldFunc, VMap, ModuleLevelChanges,
398 Value *V = VMap[BI];
415 RemapInstruction(NewBB->getTerminator(), VMap,
425 BasicBlock *NewBB = cast<BasicBlock>(VMap[OldBB]);
432 PHINode *PN = cast<PHINode>(VMap[OPN]);
434 Value *V = VMap[PN->getIncomingBlock(pred)];
437 VMap,
492 assert(VMap[OldI] == PN && "VMap mismatch");
493 VMap[OldI] = NV;
503 // WeakVH in the VMap. Notably, we rely on that so that if we coalesce
508 if (PHINode *PN = dyn_cast<PHINode>(VMap[PHIToResolve[Idx]]))
515 Function::iterator Begin = cast<BasicBlock>(VMap[&OldFunc->getEntryBlock()]);
566 for (Function::iterator I = cast<BasicBlock>(VMap[&OldFunc->getEntryBlock()]),