[PATCH] D32250: [Thumb-1] Fix corner cases for compressed jump tables
Weiming Zhao via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Apr 20 11:50:03 PDT 2017
This revision was automatically updated to reflect the committed changes.
Closed by commit rL300870: [Thumb-1] Fix corner cases for compressed jump tables (authored by weimingz).
Changed prior to commit:
https://reviews.llvm.org/D32250?vs=95996&id=95999#toc
Repository:
rL LLVM
https://reviews.llvm.org/D32250
Files:
llvm/trunk/lib/Target/ARM/ARMConstantIslandPass.cpp
Index: llvm/trunk/lib/Target/ARM/ARMConstantIslandPass.cpp
===================================================================
--- llvm/trunk/lib/Target/ARM/ARMConstantIslandPass.cpp
+++ llvm/trunk/lib/Target/ARM/ARMConstantIslandPass.cpp
@@ -2157,6 +2157,15 @@
// If we're in PIC mode, there should be another ADD following.
auto *TRI = STI->getRegisterInfo();
+
+ // %base cannot be redefined after the load as it will appear before
+ // TBB/TBH like:
+ // %base =
+ // %base =
+ // tBB %base, %idx
+ if (registerDefinedBetween(BaseReg, Load->getNextNode(), MBB->end(), TRI))
+ continue;
+
if (isPositionIndependentOrROPI) {
MachineInstr *Add = Load->getNextNode();
if (Add->getOpcode() != ARM::tADDrr ||
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D32250.95999.patch
Type: text/x-patch
Size: 800 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170420/d7aa922a/attachment.bin>
More information about the llvm-commits
mailing list