[llvm] [CodeGen][NPM] Port MachineBlockPlacement to NPM (PR #129828)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 4 22:09:36 PST 2025


================
@@ -192,6 +192,20 @@ MACHINE_FUNCTION_PASS("verify<machine-trace-metrics>", MachineTraceMetricsVerifi
 #define MACHINE_FUNCTION_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER,    \
                                           PARAMS)
 #endif
+
+MACHINE_FUNCTION_PASS_WITH_PARAMS(
+    "block-placement", "MachineBlockPlacementPass",
+    [](bool NoTailMerge) {
+      // Tail merging is enabled by default, so this option
+      // is to disable it.
+      return MachineBlockPlacementPass(!NoTailMerge);
+    },
+    [](StringRef Params) {
+      return parseSinglePassOption(Params, "no-tail-merge",
+                                   "MachineBlockPlacementPass");
----------------
arsenm wrote:

Other middle end passes accept both "name" and "no-name" options to explicitly enable or disable, not just flip default 

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


More information about the llvm-commits mailing list