diff options
author | David Goodwin <david_goodwin@apple.com> | 2009-06-30 19:50:22 +0000 |
---|---|---|
committer | David Goodwin <david_goodwin@apple.com> | 2009-06-30 19:50:22 +0000 |
commit | c9a59b5960088f48c3be234bcc4c79a1ed915d73 (patch) | |
tree | 5d212cfe72142a9e7597c5153209511e7a5568f9 /lib/Target/ARM/ARMInstrInfo.cpp | |
parent | f0c3d023ae7ccd940bb595b5ce7ac74656fa47f6 (diff) | |
download | external_llvm-c9a59b5960088f48c3be234bcc4c79a1ed915d73.zip external_llvm-c9a59b5960088f48c3be234bcc4c79a1ed915d73.tar.gz external_llvm-c9a59b5960088f48c3be234bcc4c79a1ed915d73.tar.bz2 |
Improve Thumb-2 jump table support.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74549 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/ARM/ARMInstrInfo.cpp')
-rw-r--r-- | lib/Target/ARM/ARMInstrInfo.cpp | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/lib/Target/ARM/ARMInstrInfo.cpp b/lib/Target/ARM/ARMInstrInfo.cpp index 5941b1e..35ebb7e 100644 --- a/lib/Target/ARM/ARMInstrInfo.cpp +++ b/lib/Target/ARM/ARMInstrInfo.cpp @@ -401,7 +401,8 @@ bool // correctness of Thumb constant islands. if ((SecondLastOpc == ARM::BR_JTr || SecondLastOpc==ARM::BR_JTm || SecondLastOpc == ARM::BR_JTadd || SecondLastOpc==ARM::tBR_JTr || - SecondLastOpc==ARM::t2BR_JTr) && + SecondLastOpc == ARM::t2BR_JTr || SecondLastOpc==ARM::t2BR_JTm || + SecondLastOpc == ARM::t2BR_JTadd) && (LastOpc == ARM::B || LastOpc == ARM::tB || LastOpc == ARM::t2B)) { I = LastInst; if (AllowModify) @@ -708,7 +709,9 @@ ARMBaseInstrInfo::BlockHasNoFallThrough(const MachineBasicBlock &MBB) const { case ARM::tBR_JTr: case ARM::t2BR_JTr: case ARM::BR_JTr: // Jumptable branch. + case ARM::t2BR_JTm: case ARM::BR_JTm: // Jumptable branch through mem. + case ARM::t2BR_JTadd: case ARM::BR_JTadd: // Jumptable branch add to pc. return true; default: return false; @@ -846,8 +849,10 @@ unsigned ARMBaseInstrInfo::GetInstSizeInBytes(const MachineInstr *MI) const { case ARM::BR_JTr: case ARM::BR_JTm: case ARM::BR_JTadd: - case ARM::tBR_JTr: - case ARM::t2BR_JTr: { + case ARM::t2BR_JTr: + case ARM::t2BR_JTm: + case ARM::t2BR_JTadd: + case ARM::tBR_JTr: { // These are jumptable branches, i.e. a branch followed by an inlined // jumptable. The size is 4 + 4 * number of entries. unsigned NumOps = TID.getNumOperands(); @@ -865,8 +870,7 @@ unsigned ARMBaseInstrInfo::GetInstSizeInBytes(const MachineInstr *MI) const { // bytes, we can use 16-bit entries instead. Then there won't be an // alignment issue. return getNumJTEntries(JT, JTI) * 4 + - ((MI->getOpcode()==ARM::tBR_JTr || - MI->getOpcode()==ARM::t2BR_JTr) ? 2 : 4); + ((MI->getOpcode()==ARM::tBR_JTr) ? 2 : 4); } default: // Otherwise, pseudo-instruction sizes are zero. |