From d24e7e1d9bce4121e6febe60ea7f4914dd331743 Mon Sep 17 00:00:00 2001 From: Chad Rosier Date: Thu, 27 Oct 2011 00:21:16 +0000 Subject: A branch predicated on a constant can just FastEmit an unconditional branch. llvm-svn: 143086 --- llvm/lib/Target/ARM/ARMFastISel.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'llvm/lib/Target/ARM/ARMFastISel.cpp') diff --git a/llvm/lib/Target/ARM/ARMFastISel.cpp b/llvm/lib/Target/ARM/ARMFastISel.cpp index a67c8671458..6aff834b954 100644 --- a/llvm/lib/Target/ARM/ARMFastISel.cpp +++ b/llvm/lib/Target/ARM/ARMFastISel.cpp @@ -1151,6 +1151,12 @@ bool ARMFastISel::SelectBranch(const Instruction *I) { FuncInfo.MBB->addSuccessor(TBB); return true; } + } else if (const ConstantInt *CI = + dyn_cast(BI->getCondition())) { + uint64_t Imm = CI->getZExtValue(); + MachineBasicBlock *Target = (Imm == 0) ? FBB : TBB; + FastEmitBranch(Target, DL); + return true; } unsigned CmpReg = getRegForValue(BI->getCondition()); -- cgit v1.2.3