[llvm] r272258 - [Thumb] A branch is not part of an IT block
James Molloy via llvm-commits
llvm-commits at lists.llvm.org
Thu Jun 9 04:51:30 PDT 2016
Author: jamesm
Date: Thu Jun 9 06:51:29 2016
New Revision: 272258
URL: http://llvm.org/viewvc/llvm-project?rev=272258&view=rev
Log:
[Thumb] A branch is not part of an IT block
ReplaceTailWithBranchTo assumed that if an instruction is predicated, it must be part of an IT block. This is not correct for conditional branches.
No testcase as this was triggered by the reverted patch r272017 - test coverage will occur when that patch is re-reverted and there is no known way to trigger this in the meantime.
Modified:
llvm/trunk/lib/Target/ARM/Thumb2InstrInfo.cpp
Modified: llvm/trunk/lib/Target/ARM/Thumb2InstrInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/Thumb2InstrInfo.cpp?rev=272258&r1=272257&r2=272258&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/Thumb2InstrInfo.cpp (original)
+++ llvm/trunk/lib/Target/ARM/Thumb2InstrInfo.cpp Thu Jun 9 06:51:29 2016
@@ -50,7 +50,7 @@ Thumb2InstrInfo::ReplaceTailWithBranchTo
MachineBasicBlock *NewDest) const {
MachineBasicBlock *MBB = Tail->getParent();
ARMFunctionInfo *AFI = MBB->getParent()->getInfo<ARMFunctionInfo>();
- if (!AFI->hasITBlocks()) {
+ if (!AFI->hasITBlocks() || Tail->isBranch()) {
TargetInstrInfo::ReplaceTailWithBranchTo(Tail, NewDest);
return;
}
More information about the llvm-commits
mailing list