[PATCH] D120024: [AMDGPU] Return better Changed status from SIOptimizeExecMasking

Jay Foad via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 17 01:40:24 PST 2022


foad created this revision.
foad added a reviewer: piotr.
Herald added subscribers: kerbowa, hiraditya, t-tye, tpr, dstuttard, yaxunl, nhaehnle, jvesely, kzhuravl, arsenm.
foad requested review of this revision.
Herald added subscribers: llvm-commits, wdng.
Herald added a project: LLVM.

Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D120024

Files:
  llvm/lib/Target/AMDGPU/SIOptimizeExecMasking.cpp


Index: llvm/lib/Target/AMDGPU/SIOptimizeExecMasking.cpp
===================================================================
--- llvm/lib/Target/AMDGPU/SIOptimizeExecMasking.cpp
+++ llvm/lib/Target/AMDGPU/SIOptimizeExecMasking.cpp
@@ -312,6 +312,7 @@
   //     x = s_<op>_saveexec_b64 y
   //
 
+  bool Changed = false;
   for (MachineBasicBlock &MBB : MF) {
     MachineBasicBlock::reverse_iterator I = fixTerminators(*TII, MBB);
     MachineBasicBlock::reverse_iterator E = MBB.rend();
@@ -351,6 +352,7 @@
         LLVM_DEBUG(dbgs() << "into: " << *PrepareExecInst << '\n');
 
         CopyToExecInst->eraseFromParent();
+        Changed = true;
       }
 
       continue;
@@ -456,8 +458,9 @@
       OtherInst->substituteRegister(CopyToExec, Exec,
                                     AMDGPU::NoSubRegister, *TRI);
     }
-  }
 
-  return true;
+    Changed = true;
+  }
 
+  return Changed;
 }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D120024.409543.patch
Type: text/x-patch
Size: 897 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220217/f93e2594/attachment.bin>


More information about the llvm-commits mailing list