[llvm] r293059 - [ARM] GlobalISel: Fix stack-use-after-scope bug.

Martin Bohme via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 25 06:28:20 PST 2017


Author: mboehme
Date: Wed Jan 25 08:28:19 2017
New Revision: 293059

URL: http://llvm.org/viewvc/llvm-project?rev=293059&view=rev
Log:
[ARM] GlobalISel: Fix stack-use-after-scope bug.

Summary:
Lifetime extension wasn't triggered on the result of BuildMI because the
reference was non-const. However, instead of adding a const, I've
removed the reference entirely as RVO should kick in anyway.

Reviewers: rovka, bkramer

Reviewed By: bkramer

Subscribers: aemerson, rengolin, dberris, llvm-commits, kristof.beyls

Differential Revision: https://reviews.llvm.org/D29124

Modified:
    llvm/trunk/lib/Target/ARM/ARMInstructionSelector.cpp

Modified: llvm/trunk/lib/Target/ARM/ARMInstructionSelector.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMInstructionSelector.cpp?rev=293059&r1=293058&r2=293059&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/ARMInstructionSelector.cpp (original)
+++ llvm/trunk/lib/Target/ARM/ARMInstructionSelector.cpp Wed Jan 25 08:28:19 2017
@@ -132,7 +132,7 @@ bool ARMInstructionSelector::select(Mach
         I.getOperand(0).setReg(AndResult);
 
         auto InsertBefore = std::next(I.getIterator());
-        auto &SubI =
+        auto SubI =
             BuildMI(MBB, InsertBefore, I.getDebugLoc(), TII.get(ARM::RSBri))
                 .addDef(SExtResult)
                 .addUse(AndResult)




More information about the llvm-commits mailing list