diff options
author | Sandeep Patel <deeppatel1987@gmail.com> | 2009-10-15 22:25:32 +0000 |
---|---|---|
committer | Sandeep Patel <deeppatel1987@gmail.com> | 2009-10-15 22:25:32 +0000 |
commit | 452b54a8aebee45088b2157a66ae0f9f6a9088fa (patch) | |
tree | 0e8d8cf8e003832572d17339e9e9bcf19ccb6435 /lib | |
parent | 6f122625dde52dd112ca18cc016e4846734b9a4f (diff) | |
download | external_llvm-452b54a8aebee45088b2157a66ae0f9f6a9088fa.zip external_llvm-452b54a8aebee45088b2157a66ae0f9f6a9088fa.tar.gz external_llvm-452b54a8aebee45088b2157a66ae0f9f6a9088fa.tar.bz2 |
Branches must be the last instruction in a Thumb2 IT block. Approved by Evan Cheng.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84212 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Target/ARM/Thumb2ITBlockPass.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/Target/ARM/Thumb2ITBlockPass.cpp b/lib/Target/ARM/Thumb2ITBlockPass.cpp index 98b5cbd..427c0bb 100644 --- a/lib/Target/ARM/Thumb2ITBlockPass.cpp +++ b/lib/Target/ARM/Thumb2ITBlockPass.cpp @@ -107,8 +107,12 @@ bool Thumb2ITBlockPass::InsertITBlocks(MachineBasicBlock &MBB) { // Finalize IT mask. ARMCC::CondCodes OCC = ARMCC::getOppositeCondition(CC); unsigned Mask = 0, Pos = 3; - while (MBBI != E && Pos) { + // Branches, including tricky ones like LDM_RET, need to end an IT + // block so check the instruction we just put in the block. + while (MBBI != E && Pos && + (!MI->getDesc().isBranch() && !MI->getDesc().isReturn())) { MachineInstr *NMI = &*MBBI; + MI = NMI; DebugLoc ndl = NMI->getDebugLoc(); unsigned NPredReg = 0; ARMCC::CondCodes NCC = getPredicate(NMI, NPredReg); |