diff options
Diffstat (limited to 'llvm/lib/Transforms/Utils/CloneFunction.cpp')
-rw-r--r-- | llvm/lib/Transforms/Utils/CloneFunction.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/Utils/CloneFunction.cpp b/llvm/lib/Transforms/Utils/CloneFunction.cpp index 08b370a..0ac9a5a 100644 --- a/llvm/lib/Transforms/Utils/CloneFunction.cpp +++ b/llvm/lib/Transforms/Utils/CloneFunction.cpp @@ -412,10 +412,12 @@ void PruningFunctionCloner::CloneBlock( NewBB->getInstList().push_back(NewInst); hasCalls |= (isa<CallInst>(II) && !isa<DbgInfoIntrinsic>(II)); - if (CodeInfo) + if (CodeInfo) { + CodeInfo->OrigVMap[&*II] = NewInst; if (auto *CB = dyn_cast<CallBase>(&*II)) if (CB->hasOperandBundles()) CodeInfo->OperandBundleCallSites.push_back(NewInst); + } if (const AllocaInst *AI = dyn_cast<AllocaInst>(II)) { if (isa<ConstantInt>(AI->getArraySize())) @@ -469,10 +471,12 @@ void PruningFunctionCloner::CloneBlock( NewBB->getInstList().push_back(NewInst); VMap[OldTI] = NewInst; // Add instruction map to value. - if (CodeInfo) + if (CodeInfo) { + CodeInfo->OrigVMap[OldTI] = NewInst; if (auto *CB = dyn_cast<CallBase>(OldTI)) if (CB->hasOperandBundles()) CodeInfo->OperandBundleCallSites.push_back(NewInst); + } // Recursively clone any reachable successor blocks. append_range(ToClone, successors(BB->getTerminator())); |