[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

llvm-svn: 293059
This commit is contained in:
Martin Bohme 2017-01-25 14:28:19 +00:00
parent 4df4c4a4aa
commit 8396e14e7f

View File

@ -132,7 +132,7 @@ bool ARMInstructionSelector::select(MachineInstr &I) const {
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)