[PATCH] D132292: [NFC][AMDGPU] Some cleanups in the SIOptimizeExecMasking pass.

Thomas Symalla via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Aug 20 08:33:35 PDT 2022


tsymalla updated this revision to Diff 454219.
tsymalla added a comment.

Fi clang-format issue.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D132292/new/

https://reviews.llvm.org/D132292

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
@@ -39,8 +39,8 @@
   MachineBasicBlock::reverse_iterator
   fixTerminators(MachineBasicBlock &MBB) const;
   MachineBasicBlock::reverse_iterator
-  findExecCopy(MachineBasicBlock &MBB, MachineBasicBlock::reverse_iterator I,
-               unsigned CopyToExec) const;
+  findExecCopy(MachineBasicBlock &MBB,
+               MachineBasicBlock::reverse_iterator I) const;
 
   bool isRegisterInUseBetween(MachineInstr &Stop, MachineInstr &Start,
                               MCRegister Reg, bool UseLiveOuts = false,
@@ -296,10 +296,8 @@
   return FirstNonTerm;
 }
 
-MachineBasicBlock::reverse_iterator
-SIOptimizeExecMasking::findExecCopy(MachineBasicBlock &MBB,
-                                    MachineBasicBlock::reverse_iterator I,
-                                    unsigned CopyToExec) const {
+MachineBasicBlock::reverse_iterator SIOptimizeExecMasking::findExecCopy(
+    MachineBasicBlock &MBB, MachineBasicBlock::reverse_iterator I) const {
   const unsigned InstLimit = 25;
 
   auto E = MBB.rend();
@@ -370,7 +368,6 @@
     LR.addLiveOuts(*Stop.getParent());
 
   MachineBasicBlock::reverse_iterator A(Start);
-  MachineBasicBlock::reverse_iterator E(Stop);
 
   if (IgnoreStart)
     ++A;
@@ -425,7 +422,7 @@
 
     // Scan backwards to find the def.
     auto *CopyToExecInst = &*I;
-    auto CopyFromExecInst = findExecCopy(MBB, I, CopyToExec);
+    auto CopyFromExecInst = findExecCopy(MBB, I);
     if (CopyFromExecInst == E) {
       auto PrepareExecInst = std::next(I);
       if (PrepareExecInst == E)
@@ -635,9 +632,9 @@
     return;
 
   // Tries to find a possibility to optimize a v_cmp ..., s_and_saveexec
-  // sequence by looking at an instance of a s_and_saveexec instruction. Returns
-  // a pointer to the v_cmp instruction if it is safe to replace the sequence
-  // (see the conditions in the function body). This is after register
+  // sequence by looking at an instance of an s_and_saveexec instruction.
+  // Returns a pointer to the v_cmp instruction if it is safe to replace the
+  // sequence (see the conditions in the function body). This is after register
   // allocation, so some checks on operand dependencies need to be considered.
   MachineInstr *VCmp = nullptr;
 
@@ -669,7 +666,7 @@
     return;
 
   // Don't do the transformation if the destination operand is included in
-  // it's MBB Live-outs, meaning it's used in any of it's successors, leading
+  // it's MBB Live-outs, meaning it's used in any of its successors, leading
   // to incorrect code if the v_cmp and therefore the def of
   // the dest operand is removed.
   if (isLiveOut(*VCmp->getParent(), VCmpDest->getReg()))


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D132292.454219.patch
Type: text/x-patch
Size: 2872 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220820/136cc7e2/attachment.bin>


More information about the llvm-commits mailing list