Lines Matching refs:VMap
40 ValueToValueMapTy &VMap, in CloneBasicBlock() argument
55 VMap[&*II] = NewInst; // Add instruction map to value. in CloneBasicBlock()
79 ValueToValueMapTy &VMap, in CloneFunctionInto() argument
89 assert(VMap.count(&I) && "No mapping from source argument specified!"); in CloneFunctionInto()
101 MapValue(OldFunc->getPersonalityFn(), VMap, in CloneFunctionInto()
108 if (Argument *NewArg = dyn_cast<Argument>(VMap[&OldArg])) { in CloneFunctionInto()
131 BasicBlock *CBB = CloneBasicBlock(&BB, VMap, NameSuffix, NewFunc, CodeInfo); in CloneFunctionInto()
134 VMap[&BB] = CBB; in CloneFunctionInto()
145 VMap[OldBBAddr] = BlockAddress::get(NewFunc, CBB); in CloneFunctionInto()
156 cast<BasicBlock>(VMap[&OldFunc->front()])->getIterator(), in CloneFunctionInto()
161 RemapInstruction(&II, VMap, in CloneFunctionInto()
191 ValueToValueMapTy &VMap) { in CloneDebugInfoMetadata() argument
199 cast<DISubprogram>(MapMetadata(OldSubprogramMDNode, VMap)); in CloneDebugInfoMetadata()
223 Function *llvm::CloneFunction(const Function *F, ValueToValueMapTy &VMap, in CloneFunction() argument
232 if (VMap.count(&I) == 0) // Haven't mapped the argument to anything yet? in CloneFunction()
245 if (VMap.count(&I) == 0) { // Is this argument preserved? in CloneFunction()
247 VMap[&I] = &*DestI++; // Add mapping to VMap in CloneFunction()
251 CloneDebugInfoMetadata(NewF, F, VMap); in CloneFunction()
254 CloneFunctionInto(NewF, F, VMap, ModuleLevelChanges, Returns, "", CodeInfo); in CloneFunction()
265 ValueToValueMapTy &VMap; member
278 : NewFunc(newFunc), OldFunc(oldFunc), VMap(valueMap), in PruningFunctionCloner()
304 WeakVH &BBEntry = VMap[BB]; in CloneBlock()
326 VMap[OldBBAddr] = BlockAddress::get(NewFunc, NewBB); in CloneBlock()
338 Director->handleInstruction(VMap, &*II, NewBB); in CloneBlock()
358 RemapInstruction(NewInst, VMap, in CloneBlock()
369 if (Value *MappedV = VMap.lookup(V)) in CloneBlock()
372 VMap[&*II] = V; in CloneBlock()
380 VMap[&*II] = NewInst; // Add instruction map to value. in CloneBlock()
402 = Director->handleInstruction(VMap, OldTI, NewBB); in CloneBlock()
426 Value *V = VMap[BI->getCondition()]; in CloneBlock()
433 VMap[OldTI] = BranchInst::Create(Dest, NewBB); in CloneBlock()
442 Value *V = VMap[SI->getCondition()]; in CloneBlock()
448 VMap[OldTI] = BranchInst::Create(Dest, NewBB); in CloneBlock()
459 VMap[OldTI] = NewInst; // Add instruction map to value. in CloneBlock()
485 ValueToValueMapTy &VMap, in CloneAndPruneIntoFromInst() argument
506 assert(VMap.count(&II) && "No mapping from source argument specified!"); in CloneAndPruneIntoFromInst()
509 PruningFunctionCloner PFC(NewFunc, OldFunc, VMap, ModuleLevelChanges, in CloneAndPruneIntoFromInst()
535 Value *V = VMap[&BI]; in CloneAndPruneIntoFromInst()
548 if (isa<PHINode>(VMap[PN])) in CloneAndPruneIntoFromInst()
559 RemapInstruction(NewBB->getTerminator(), VMap, in CloneAndPruneIntoFromInst()
570 BasicBlock *NewBB = cast<BasicBlock>(VMap[OldBB]); in CloneAndPruneIntoFromInst()
577 PHINode *PN = cast<PHINode>(VMap[OPN]); in CloneAndPruneIntoFromInst()
579 Value *V = VMap[PN->getIncomingBlock(pred)]; in CloneAndPruneIntoFromInst()
582 VMap, in CloneAndPruneIntoFromInst()
637 assert(VMap[&*OldI] == PN && "VMap mismatch"); in CloneAndPruneIntoFromInst()
638 VMap[&*OldI] = NV; in CloneAndPruneIntoFromInst()
653 if (PHINode *PN = dyn_cast<PHINode>(VMap[PHIToResolve[Idx]])) in CloneAndPruneIntoFromInst()
660 Function::iterator Begin = cast<BasicBlock>(VMap[StartingBB])->getIterator(); in CloneAndPruneIntoFromInst()
711 for (Function::iterator I = cast<BasicBlock>(VMap[StartingBB])->getIterator(), in CloneAndPruneIntoFromInst()
727 ValueToValueMapTy &VMap, in CloneAndPruneFunctionInto() argument
733 CloneAndPruneIntoFromInst(NewFunc, OldFunc, &OldFunc->front().front(), VMap, in CloneAndPruneFunctionInto()
740 const SmallVectorImpl<BasicBlock *> &Blocks, ValueToValueMapTy &VMap) { in remapInstructionsInBlocks() argument
744 RemapInstruction(&Inst, VMap, in remapInstructionsInBlocks()
754 Loop *OrigLoop, ValueToValueMapTy &VMap, in cloneLoopWithPreheader() argument
769 BasicBlock *NewPH = CloneBasicBlock(OrigPH, VMap, NameSuffix, F); in cloneLoopWithPreheader()
771 VMap[OrigPH] = NewPH; in cloneLoopWithPreheader()
782 BasicBlock *NewBB = CloneBasicBlock(BB, VMap, NameSuffix, F); in cloneLoopWithPreheader()
783 VMap[BB] = NewBB; in cloneLoopWithPreheader()
790 DT->addNewBlock(NewBB, cast<BasicBlock>(VMap[IDomBB])); in cloneLoopWithPreheader()