summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/ARM/ARMInstrInfo.cpp
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2007-05-21 23:17:32 +0000
committerEvan Cheng <evan.cheng@apple.com>2007-05-21 23:17:32 +0000
commit8c8afb27d7cba60022a2acc08f98d470e7c48980 (patch)
treea5558d99ac76aeaa1c152872f8785762949f2de1 /llvm/lib/Target/ARM/ARMInstrInfo.cpp
parentd1de276c1697777c8a3f906ddfc9b43f09956d0a (diff)
downloadbcm5719-llvm-8c8afb27d7cba60022a2acc08f98d470e7c48980.tar.gz
bcm5719-llvm-8c8afb27d7cba60022a2acc08f98d470e7c48980.zip
Fix some -march=thumb regressions. tBR_JTr is not predicable.
llvm-svn: 37272
Diffstat (limited to 'llvm/lib/Target/ARM/ARMInstrInfo.cpp')
-rw-r--r--llvm/lib/Target/ARM/ARMInstrInfo.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/llvm/lib/Target/ARM/ARMInstrInfo.cpp b/llvm/lib/Target/ARM/ARMInstrInfo.cpp
index 78f8de4d6d7..186c3dd587f 100644
--- a/llvm/lib/Target/ARM/ARMInstrInfo.cpp
+++ b/llvm/lib/Target/ARM/ARMInstrInfo.cpp
@@ -498,7 +498,9 @@ unsigned ARM::GetInstSize(MachineInstr *MI) {
// These are jumptable branches, i.e. a branch followed by an inlined
// jumptable. The size is 4 + 4 * number of entries.
unsigned NumOps = TID->numOperands;
- unsigned JTI = MI->getOperand(NumOps-3).getJumpTableIndex();
+ MachineOperand JTOP =
+ MI->getOperand(NumOps - ((TID->Flags & M_PREDICABLE) ? 3 : 2));
+ unsigned JTI = JTOP.getJumpTableIndex();
MachineJumpTableInfo *MJTI = MF->getJumpTableInfo();
const std::vector<MachineJumpTableEntry> &JT = MJTI->getJumpTables();
assert(JTI < JT.size());
OpenPOWER on IntegriCloud