From 8f2ed1bc5a8486f1bd4f12b62e91af5822c13f8a Mon Sep 17 00:00:00 2001 From: Evan Cheng Date: Mon, 27 Jul 2009 18:25:24 +0000 Subject: [PATCH] Clean up. llvm-svn: 77221 --- llvm/lib/Target/ARM/ARMBaseInstrInfo.cpp | 6 +----- llvm/lib/Target/ARM/ARMBaseInstrInfo.h | 5 +++++ 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/llvm/lib/Target/ARM/ARMBaseInstrInfo.cpp b/llvm/lib/Target/ARM/ARMBaseInstrInfo.cpp index e058c8ad1ad1..5703f6b88561 100644 --- a/llvm/lib/Target/ARM/ARMBaseInstrInfo.cpp +++ b/llvm/lib/Target/ARM/ARMBaseInstrInfo.cpp @@ -251,11 +251,7 @@ ARMBaseInstrInfo::AnalyzeBranch(MachineBasicBlock &MBB,MachineBasicBlock *&TBB, // ...likewise if it ends with a branch table followed by an unconditional // branch. The branch folder can create these, and we must get rid of them for // 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_JT) && + if (isJumpTableBranchOpcode(SecondLastOpc) && isUncondBranchOpcode(LastOpc)) { I = LastInst; if (AllowModify) diff --git a/llvm/lib/Target/ARM/ARMBaseInstrInfo.h b/llvm/lib/Target/ARM/ARMBaseInstrInfo.h index 375410dac1b1..e91d1ebf0e5a 100644 --- a/llvm/lib/Target/ARM/ARMBaseInstrInfo.h +++ b/llvm/lib/Target/ARM/ARMBaseInstrInfo.h @@ -301,6 +301,11 @@ private: return Opc == ARM::Bcc || Opc == ARM::tBcc || Opc == ARM::t2Bcc; } + bool isJumpTableBranchOpcode(int Opc) const { + return Opc == ARM::BR_JTr || Opc == ARM::BR_JTm || Opc == ARM::BR_JTadd || + Opc == ARM::tBR_JTr || Opc == ARM::t2BR_JT; + } + int getMatchingCondBranchOpcode(int Opc) const; }; }