[llvm] r199919 - R600: Remove successive JUMP in AnalyzeBranch when AllowModify is true

Tom Stellard thomas.stellard at amd.com
Thu Jan 23 10:49:34 PST 2014


Author: tstellar
Date: Thu Jan 23 12:49:34 2014
New Revision: 199919

URL: http://llvm.org/viewvc/llvm-project?rev=199919&view=rev
Log:
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

Modified:
    llvm/trunk/lib/Target/R600/R600InstrInfo.cpp

Modified: llvm/trunk/lib/Target/R600/R600InstrInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/R600/R600InstrInfo.cpp?rev=199919&r1=199918&r2=199919&view=diff
==============================================================================
--- llvm/trunk/lib/Target/R600/R600InstrInfo.cpp (original)
+++ llvm/trunk/lib/Target/R600/R600InstrInfo.cpp Thu Jan 23 12:49:34 2014
@@ -716,7 +716,13 @@ R600InstrInfo::AnalyzeBranch(MachineBasi
     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.





More information about the llvm-commits mailing list