aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Molloy <james.molloy@arm.com>2016-06-09 11:51:29 +0000
committerJames Molloy <james.molloy@arm.com>2016-06-09 11:51:29 +0000
commita7dbf987b5da24b223d91c1b35b9f8343c38e648 (patch)
tree8d811fd193eeecc8e7ef9718d8e17084ee419d96
parentf635367e2b06775879eb3152629ca9220e4864a2 (diff)
downloadllvm-a7dbf987b5da24b223d91c1b35b9f8343c38e648.zip
llvm-a7dbf987b5da24b223d91c1b35b9f8343c38e648.tar.gz
llvm-a7dbf987b5da24b223d91c1b35b9f8343c38e648.tar.bz2
[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. llvm-svn: 272258
-rw-r--r--llvm/lib/Target/ARM/Thumb2InstrInfo.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Target/ARM/Thumb2InstrInfo.cpp b/llvm/lib/Target/ARM/Thumb2InstrInfo.cpp
index 4ddf3dc..a078285 100644
--- a/llvm/lib/Target/ARM/Thumb2InstrInfo.cpp
+++ b/llvm/lib/Target/ARM/Thumb2InstrInfo.cpp
@@ -50,7 +50,7 @@ Thumb2InstrInfo::ReplaceTailWithBranchTo(MachineBasicBlock::iterator Tail,
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;
}