[llvm] [CodeGen][NPM] Update BranchFolderLegacy make tail merge configurable via flag (PR #135277)

Mikhail R. Gadelha via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 10 16:11:13 PDT 2025


================
@@ -90,10 +90,13 @@ namespace {
 
   /// BranchFolderPass - Wrap branch folder in a machine function pass.
 class BranchFolderLegacy : public MachineFunctionPass {
+  bool EnableTailMerge;
+
 public:
   static char ID;
 
-  explicit BranchFolderLegacy() : MachineFunctionPass(ID) {}
+  explicit BranchFolderLegacy(bool EnableTailMerge = true)
+      : MachineFunctionPass(ID), EnableTailMerge(EnableTailMerge) {}
----------------
mikhailramalho wrote:

> That added the initial port to the new pm. This is now changing the pass arguments in the old PM, without the matching new PM change

Are you talking about the default argument? I see that `BranchFolderPass` already takes a `bool EnableTailMerge`: https://github.com/llvm/llvm-project/blob/b39ab7a620e1bd038d6c22a667110ad814596288/llvm/include/llvm/CodeGen/BranchFoldingPass.h#L19

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


More information about the llvm-commits mailing list