[llvm] [AMDGPU][SIPreEmitPeephole] mustRetainExeczBranch: estimate ThenBlock cost using MachineTraceInfo (PR #111117)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 4 08:17:27 PDT 2024


Juan Manuel Martinez =?utf-8?q?Caama=C3=B1o?= <juamarti at amd.com>,
Juan Manuel Martinez =?utf-8?q?Caama=C3=B1o?= <juamarti at amd.com>
Message-ID:
In-Reply-To: <llvm.org/llvm/llvm-project/pull/111117 at github.com>


================
@@ -326,15 +345,32 @@ bool SIPreEmitPeephole::mustRetainExeczBranch(
       if (TII->hasUnwantedEffectsWhenEXECEmpty(MI))
         return true;
 
-      // These instructions are potentially expensive even if EXEC = 0.
-      if (TII->isSMRD(MI) || TII->isVMEM(MI) || TII->isFLAT(MI) ||
-          TII->isDS(MI) || TII->isWaitcnt(MI.getOpcode()))
-        return true;
-
-      ++NumInstr;
-      if (NumInstr >= SkipThreshold)
+      if (TII->isWaitcnt(MI.getOpcode()))
         return true;
     }
+
+    if (!MinInstr)
+      MinInstr = Traces->getEnsemble(MachineTraceStrategy::TS_Local);
----------------
arsenm wrote:

Just initialize this in pass setup? Seems to be a constant? 

https://github.com/llvm/llvm-project/pull/111117


More information about the llvm-commits mailing list