[llvm] 768e6fa - [AMDGPU] Return better Changed status from SILowerControlFlow

Jay Foad via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 18 02:13:00 PST 2022


Author: Jay Foad
Date: 2022-02-18T10:09:22Z
New Revision: 768e6faba8fa5eef04276a51836a40c5ab8013bc

URL: https://github.com/llvm/llvm-project/commit/768e6faba8fa5eef04276a51836a40c5ab8013bc
DIFF: https://github.com/llvm/llvm-project/commit/768e6faba8fa5eef04276a51836a40c5ab8013bc.diff

LOG: [AMDGPU] Return better Changed status from SILowerControlFlow

Differential Revision: https://reviews.llvm.org/D120025

Added: 
    

Modified: 
    llvm/lib/Target/AMDGPU/SILowerControlFlow.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/AMDGPU/SILowerControlFlow.cpp b/llvm/lib/Target/AMDGPU/SILowerControlFlow.cpp
index e1018bdfde46..4bb05d906978 100644
--- a/llvm/lib/Target/AMDGPU/SILowerControlFlow.cpp
+++ b/llvm/lib/Target/AMDGPU/SILowerControlFlow.cpp
@@ -865,6 +865,7 @@ bool SILowerControlFlow::runOnMachineFunction(MachineFunction &MF) {
     }
   }
 
+  bool Changed = false;
   MachineFunction::iterator NextBB;
   for (MachineFunction::iterator BI = MF.begin();
        BI != MF.end(); BI = NextBB) {
@@ -886,6 +887,7 @@ bool SILowerControlFlow::runOnMachineFunction(MachineFunction &MF) {
       case AMDGPU::SI_LOOP:
       case AMDGPU::SI_END_CF:
         SplitMBB = process(MI);
+        Changed = true;
         break;
 
       // FIXME: find a better place for this
@@ -894,6 +896,7 @@ bool SILowerControlFlow::runOnMachineFunction(MachineFunction &MF) {
         lowerInitExec(MBB, MI);
         if (LIS)
           LIS->removeAllRegUnitsForPhysReg(AMDGPU::EXEC);
+        Changed = true;
         break;
 
       default:
@@ -913,5 +916,5 @@ bool SILowerControlFlow::runOnMachineFunction(MachineFunction &MF) {
   LoweredIf.clear();
   KillBlocks.clear();
 
-  return true;
+  return Changed;
 }


        


More information about the llvm-commits mailing list