Skip to content
This repository was archived by the owner on Feb 5, 2019. It is now read-only.

Commit 63875e6

Browse files
committed
R600: Remove successive JUMP in AnalyzeBranch when AllowModify is true
This fixes a crash in the OpenCV OpenCL test suite. There is no lit test for this, because the test would be very large and could easily be invalidated by changes to the scheduler or other parts of the compiler. Patch by: Vincent Lejeune git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199919 91177308-0d34-0410-b5e6-96231b3b80d8
1 parent 35f321d commit 63875e6

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

lib/Target/R600/R600InstrInfo.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -716,7 +716,13 @@ R600InstrInfo::AnalyzeBranch(MachineBasicBlock &MBB,
716716
return false;
717717
}
718718

719-
// Get the last instruction in the block.
719+
// Remove successive JUMP
720+
while (I != MBB.begin() && llvm::prior(I)->getOpcode() == AMDGPU::JUMP) {
721+
MachineBasicBlock::iterator PriorI = llvm::prior(I);
722+
if (AllowModify)
723+
I->removeFromParent();
724+
I = PriorI;
725+
}
720726
MachineInstr *LastInst = I;
721727

722728
// If there is only one terminator instruction, process it.

0 commit comments

Comments
 (0)