[PATCH] R600: Remove successive JUMP in AnalyzeBranch when	AllowModify is true
    Tom Stellard 
    tom at stellard.net
       
    Wed Dec 18 09:29:42 PST 2013
    
    
  
On Tue, Dec 03, 2013 at 10:10:52AM -0800, Vincent Lejeune wrote:
> http://llvm-reviews.chandlerc.com/D2322
> 
This patch is:
Reviewed-by: Tom Stellard <thomas.stellard at amd.com>
This bug is exercised by a test in the OpenCV test-suite.  If you can
find a small lit test to trigger it that would be great, but if not,
it's OK to commit without a lit test.
-Tom
> Files:
>   lib/Target/R600/R600InstrInfo.cpp
> 
> Index: lib/Target/R600/R600InstrInfo.cpp
> ===================================================================
> --- lib/Target/R600/R600InstrInfo.cpp
> +++ lib/Target/R600/R600InstrInfo.cpp
> @@ -720,7 +720,13 @@
>      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.
> Index: lib/Target/R600/R600InstrInfo.cpp
> ===================================================================
> --- lib/Target/R600/R600InstrInfo.cpp
> +++ lib/Target/R600/R600InstrInfo.cpp
> @@ -720,7 +720,13 @@
>      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.
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
    
    
More information about the llvm-commits
mailing list