[PATCH] D16434: Fix ARM load/store opt live reg computing
Weiming Zhao via llvm-commits
llvm-commits at lists.llvm.org
Thu Jan 21 16:13:46 PST 2016
weimingz created this revision.
weimingz added a reviewer: t.p.northover.
weimingz added a subscriber: llvm-commits.
weimingz set the repository for this revision to rL LLVM.
Herald added subscribers: rengolin, aemerson.
Shrink-wrap may hoist the restore of LR from exiting BB. So when
moveLiveRegsBefore() computes free regs, it will not count LR as live.
This patch marks LR could be clobbed when it encounters a bx_ret inst.
Repository:
rL LLVM
http://reviews.llvm.org/D16434
Files:
lib/Target/ARM/ARMLoadStoreOptimizer.cpp
Index: lib/Target/ARM/ARMLoadStoreOptimizer.cpp
===================================================================
--- lib/Target/ARM/ARMLoadStoreOptimizer.cpp
+++ lib/Target/ARM/ARMLoadStoreOptimizer.cpp
@@ -560,6 +560,9 @@
while (LiveRegPos != Before) {
--LiveRegPos;
LiveRegs.stepBackward(*LiveRegPos);
+ if (LiveRegPos->getOpcode() == ARM::tBX_RET ||
+ LiveRegPos->getOpcode() == ARM::tBX_RET)
+ LiveRegs.addReg(ARM::LR);
}
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D16434.45611.patch
Type: text/x-patch
Size: 465 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160122/e1aa42f3/attachment.bin>
More information about the llvm-commits
mailing list