diff options
author | Tom Stellard <thomas.stellard@amd.com> | 2014-03-24 18:21:30 +0000 |
---|---|---|
committer | Tom Stellard <thomas.stellard@amd.com> | 2014-03-24 18:21:30 +0000 |
commit | ff1afeb16df041f870fffbae5b23167a950b590b (patch) | |
tree | 272ac24981bba4310a92628975065cfe5b9ae5d9 | |
parent | bcc1d80afbd2403ad02fa5ba9b3ae0779c24413b (diff) | |
download | llvm-ff1afeb16df041f870fffbae5b23167a950b590b.tar.gz llvm-ff1afeb16df041f870fffbae5b23167a950b590b.tar.bz2 llvm-ff1afeb16df041f870fffbae5b23167a950b590b.tar.xz |
Merging r199919:
------------------------------------------------------------------------
r199919 | thomas.stellard | 2014-01-23 10:49:34 -0800 (Thu, 23 Jan 2014) | 10 lines
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/branches/release_34@204641 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/Target/R600/R600InstrInfo.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/Target/R600/R600InstrInfo.cpp b/lib/Target/R600/R600InstrInfo.cpp index c0827fc1ca..2eca6cf432 100644 --- a/lib/Target/R600/R600InstrInfo.cpp +++ b/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. |