[llvm] [AMDGPU][NewPM] Port SIShrinkInstructions to new pass manager. (PR #106967)

Pravin Jagtap via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 2 08:11:29 PDT 2024


================
@@ -1077,3 +1081,21 @@ bool SIShrinkInstructions::runOnMachineFunction(MachineFunction &MF) {
   }
   return false;
 }
+
+bool SIShrinkInstructionsLegacy::runOnMachineFunction(MachineFunction &MF) {
+  if (skipFunction(MF.getFunction()))
+    return false;
+
+  return SIShrinkInstructions().run(MF);
+}
+
+PreservedAnalyses
+SIShrinkInstructionsPass::run(MachineFunction &MF,
+                              MachineFunctionAnalysisManager &) {
+  if (MF.getFunction().hasOptNone() || !SIShrinkInstructions().run(MF))
----------------
pravinjagtap wrote:

Shouldn't codegen pipeline builder take care of opt none? I am not sure when to use TM and Fcn attribute to decide pass invocatoin.

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


More information about the llvm-commits mailing list