[PATCH] D134726: [AMDGPU][SetWavePriority] Fix dealing with MBBInfo records.

Ivan Kosarev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 30 06:28:15 PDT 2022


This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rGa964099ce5e5: [AMDGPU][SetWavePriority] Fix dealing with MBBInfo records. (authored by kosarev).

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D134726

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


Index: llvm/lib/Target/AMDGPU/AMDGPUSetWavePriority.cpp
===================================================================
--- llvm/lib/Target/AMDGPU/AMDGPUSetWavePriority.cpp
+++ llvm/lib/Target/AMDGPU/AMDGPUSetWavePriority.cpp
@@ -122,13 +122,13 @@
   // executed provided no backedge is ever taken.
   MBBInfoSet MBBInfos;
   for (MachineBasicBlock *MBB : post_order(&MF)) {
-    MBBInfo &Info = MBBInfos[MBB];
     bool AtStart = true;
     unsigned MaxNumVALUInstsInMiddle = 0;
     unsigned NumVALUInstsAtEnd = 0;
     for (MachineInstr &MI : *MBB) {
       if (isVMEMLoad(MI)) {
         AtStart = false;
+        MBBInfo &Info = MBBInfos[MBB];
         Info.NumVALUInstsAtStart = 0;
         MaxNumVALUInstsInMiddle = 0;
         NumVALUInstsAtEnd = 0;
@@ -140,7 +140,7 @@
         NumVALUInstsAtEnd = 0;
       } else if (SIInstrInfo::isVALU(MI)) {
         if (AtStart)
-          ++Info.NumVALUInstsAtStart;
+          ++MBBInfos[MBB].NumVALUInstsAtStart;
         ++NumVALUInstsAtEnd;
       }
     }
@@ -152,6 +152,7 @@
       NumFollowingVALUInsts =
           std::max(NumFollowingVALUInsts, MBBInfos[Succ].NumVALUInstsAtStart);
     }
+    MBBInfo &Info = MBBInfos[MBB];
     if (AtStart)
       Info.NumVALUInstsAtStart += NumFollowingVALUInsts;
     NumVALUInstsAtEnd += NumFollowingVALUInsts;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D134726.464244.patch
Type: text/x-patch
Size: 1313 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220930/1fe987de/attachment-0001.bin>


More information about the llvm-commits mailing list