diff options
| author | Martin Bohme <mboehme@google.com> | 2017-01-25 14:28:19 +0000 |
|---|---|---|
| committer | Martin Bohme <mboehme@google.com> | 2017-01-25 14:28:19 +0000 |
| commit | 8396e14e7f3d16e1c5dc1ea89cb9cdc24c406f66 (patch) | |
| tree | 87defbd716ef4ba24b2ee0f6fdab09769b21f42c /llvm/lib/Target/ARM/ARMInstructionSelector.cpp | |
| parent | 4df4c4a4aaabeb5d68cfa461e8178f6561476a9e (diff) | |
| download | bcm5719-llvm-8396e14e7f3d16e1c5dc1ea89cb9cdc24c406f66.tar.gz bcm5719-llvm-8396e14e7f3d16e1c5dc1ea89cb9cdc24c406f66.zip | |
[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
Diffstat (limited to 'llvm/lib/Target/ARM/ARMInstructionSelector.cpp')
| -rw-r--r-- | llvm/lib/Target/ARM/ARMInstructionSelector.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Target/ARM/ARMInstructionSelector.cpp b/llvm/lib/Target/ARM/ARMInstructionSelector.cpp index 5a4d6a874e6..4167344337d 100644 --- a/llvm/lib/Target/ARM/ARMInstructionSelector.cpp +++ b/llvm/lib/Target/ARM/ARMInstructionSelector.cpp @@ -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) |

