diff options
author | Evan Cheng <evan.cheng@apple.com> | 2009-08-15 07:59:10 +0000 |
---|---|---|
committer | Evan Cheng <evan.cheng@apple.com> | 2009-08-15 07:59:10 +0000 |
commit | 6ddd7bcdd1fe88e8c2e30169e964986532fed825 (patch) | |
tree | 712a4e0981866eee84eec4b3bac2c350e1f4fcaa /llvm/lib/Target/ARM/Thumb2ITBlockPass.cpp | |
parent | 84ff2c93486b15d2132716f642a940b8fb58d3e1 (diff) | |
download | bcm5719-llvm-6ddd7bcdd1fe88e8c2e30169e964986532fed825.tar.gz bcm5719-llvm-6ddd7bcdd1fe88e8c2e30169e964986532fed825.zip |
Turn on if-conversion for thumb2.
llvm-svn: 79084
Diffstat (limited to 'llvm/lib/Target/ARM/Thumb2ITBlockPass.cpp')
-rw-r--r-- | llvm/lib/Target/ARM/Thumb2ITBlockPass.cpp | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/llvm/lib/Target/ARM/Thumb2ITBlockPass.cpp b/llvm/lib/Target/ARM/Thumb2ITBlockPass.cpp index da7228b3457..e74a526afae 100644 --- a/llvm/lib/Target/ARM/Thumb2ITBlockPass.cpp +++ b/llvm/lib/Target/ARM/Thumb2ITBlockPass.cpp @@ -66,23 +66,19 @@ bool Thumb2ITBlockPass::InsertITBlocks(MachineBasicBlock &MBB) { .addImm(CC); ++MBBI; - // Finalize IT mask. If the following instruction is not predicated or it's - // predicated on a condition that's not the same or the opposite of CC, then - // the mask is 0x8. + // Finalize IT mask. ARMCC::CondCodes OCC = ARMCC::getOppositeCondition(CC); - unsigned Mask = 0x8; - while (MBBI != E || (Mask & 1)) { + unsigned Mask = 0, Pos = 3; + while (MBBI != E && Pos) { ARMCC::CondCodes NCC = getPredicate(&*MBBI, TII); - if (NCC == CC) { - Mask >>= 1; - Mask |= 0x8; - } else if (NCC == OCC) { - Mask >>= 1; - } else { + if (NCC == OCC) { + Mask |= (1 << Pos); + } else if (NCC != CC) break; - } + --Pos; ++MBBI; } + Mask |= (1 << Pos); MIB.addImm(Mask); Modified = true; ++NumITs; |