diff options
author | Chad Rosier <mcrosier@apple.com> | 2011-10-27 00:21:16 +0000 |
---|---|---|
committer | Chad Rosier <mcrosier@apple.com> | 2011-10-27 00:21:16 +0000 |
commit | d24e7e1d9bce4121e6febe60ea7f4914dd331743 (patch) | |
tree | ea1142eedeb6b27f6aadca3fd117ffb63dbdac0b /llvm/lib | |
parent | a9aabf7d5123c4c0c8a824769d9e2512946efa9d (diff) | |
download | bcm5719-llvm-d24e7e1d9bce4121e6febe60ea7f4914dd331743.tar.gz bcm5719-llvm-d24e7e1d9bce4121e6febe60ea7f4914dd331743.zip |
A branch predicated on a constant can just FastEmit an unconditional branch.
llvm-svn: 143086
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/Target/ARM/ARMFastISel.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
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<ConstantInt>(BI->getCondition())) { + uint64_t Imm = CI->getZExtValue(); + MachineBasicBlock *Target = (Imm == 0) ? FBB : TBB; + FastEmitBranch(Target, DL); + return true; } unsigned CmpReg = getRegForValue(BI->getCondition()); |