From 94679e66bbad22dc1a6e3e1b3f8fa9bab0db0f67 Mon Sep 17 00:00:00 2001 From: Evan Cheng Date: Mon, 21 May 2007 23:17:32 +0000 Subject: [PATCH] Fix some -march=thumb regressions. tBR_JTr is not predicable. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37272 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Target/ARM/ARMInstrInfo.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/Target/ARM/ARMInstrInfo.cpp b/lib/Target/ARM/ARMInstrInfo.cpp index 78f8de4d6d7..186c3dd587f 100644 --- a/lib/Target/ARM/ARMInstrInfo.cpp +++ b/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 &JT = MJTI->getJumpTables(); assert(JTI < JT.size());