diff options
Diffstat (limited to 'llvm/lib/Transforms/Utils/CodeExtractor.cpp')
-rw-r--r-- | llvm/lib/Transforms/Utils/CodeExtractor.cpp | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/llvm/lib/Transforms/Utils/CodeExtractor.cpp b/llvm/lib/Transforms/Utils/CodeExtractor.cpp index 2e073e89dde..023ab76d001 100644 --- a/llvm/lib/Transforms/Utils/CodeExtractor.cpp +++ b/llvm/lib/Transforms/Utils/CodeExtractor.cpp @@ -886,16 +886,14 @@ Function *CodeExtractor::constructFunction(const ValueSet &inputs, } /// Erase lifetime.start markers which reference inputs to the extraction -/// region, and insert the referenced memory into \p LifetimesStart. Do the same -/// with lifetime.end markers (but insert them into \p LifetimesEnd). +/// region, and insert the referenced memory into \p LifetimesStart. /// /// The extraction region is defined by a set of blocks (\p Blocks), and a set /// of allocas which will be moved from the caller function into the extracted /// function (\p SunkAllocas). static void eraseLifetimeMarkersOnInputs(const SetVector<BasicBlock *> &Blocks, const SetVector<Value *> &SunkAllocas, - SetVector<Value *> &LifetimesStart, - SetVector<Value *> &LifetimesEnd) { + SetVector<Value *> &LifetimesStart) { for (BasicBlock *BB : Blocks) { for (auto It = BB->begin(), End = BB->end(); It != End;) { auto *II = dyn_cast<IntrinsicInst>(&*It); @@ -912,8 +910,6 @@ static void eraseLifetimeMarkersOnInputs(const SetVector<BasicBlock *> &Blocks, if (II->getIntrinsicID() == Intrinsic::lifetime_start) LifetimesStart.insert(Mem); - else - LifetimesEnd.insert(Mem); II->eraseFromParent(); } } @@ -1421,12 +1417,11 @@ Function *CodeExtractor::extractCodeRegion() { } // Collect objects which are inputs to the extraction region and also - // referenced by lifetime start/end markers within it. The effects of these + // referenced by lifetime start markers within it. The effects of these // markers must be replicated in the calling function to prevent the stack // coloring pass from merging slots which store input objects. - ValueSet LifetimesStart, LifetimesEnd; - eraseLifetimeMarkersOnInputs(Blocks, SinkingCands, LifetimesStart, - LifetimesEnd); + ValueSet LifetimesStart; + eraseLifetimeMarkersOnInputs(Blocks, SinkingCands, LifetimesStart); // Construct new function based on inputs/outputs & add allocas for all defs. Function *newFunction = @@ -1449,9 +1444,8 @@ Function *CodeExtractor::extractCodeRegion() { // Replicate the effects of any lifetime start/end markers which referenced // input objects in the extraction region by placing markers around the call. - insertLifetimeMarkersSurroundingCall(oldFunction->getParent(), - LifetimesStart.getArrayRef(), - LifetimesEnd.getArrayRef(), TheCall); + insertLifetimeMarkersSurroundingCall( + oldFunction->getParent(), LifetimesStart.getArrayRef(), {}, TheCall); // Propagate personality info to the new function if there is one. if (oldFunction->hasPersonalityFn()) |