summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTom Stellard <thomas.stellard@amd.com>2014-01-23 18:49:34 +0000
committerTom Stellard <thomas.stellard@amd.com>2014-01-23 18:49:34 +0000
commita64353e5bd5ce18aac69abfb0c1ece10b325ea18 (patch)
tree90da77c5cd75447c9d7c8a7833b888c77438150e
parenta2a4b8ee2f04176ea7a32a66bb9d493d0d292c33 (diff)
downloadbcm5719-llvm-a64353e5bd5ce18aac69abfb0c1ece10b325ea18.tar.gz
bcm5719-llvm-a64353e5bd5ce18aac69abfb0c1ece10b325ea18.zip
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 llvm-svn: 199919
-rw-r--r--llvm/lib/Target/R600/R600InstrInfo.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/llvm/lib/Target/R600/R600InstrInfo.cpp b/llvm/lib/Target/R600/R600InstrInfo.cpp
index c0827fc1ca4..2eca6cf4327 100644
--- a/llvm/lib/Target/R600/R600InstrInfo.cpp
+++ b/llvm/lib/Target/R600/R600InstrInfo.cpp
@@ -716,7 +716,13 @@ R600InstrInfo::AnalyzeBranch(MachineBasicBlock &MBB,
return false;
}
- // Get the last instruction in the block.
+ // Remove successive JUMP
+ while (I != MBB.begin() && llvm::prior(I)->getOpcode() == AMDGPU::JUMP) {
+ MachineBasicBlock::iterator PriorI = llvm::prior(I);
+ if (AllowModify)
+ I->removeFromParent();
+ I = PriorI;
+ }
MachineInstr *LastInst = I;
// If there is only one terminator instruction, process it.
OpenPOWER on IntegriCloud