[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
Fri Apr 11 12:35:55 PDT 2025


================
@@ -152,7 +162,8 @@ bool BranchFolderLegacy::runOnMachineFunction(MachineFunction &MF) {
   // TailMerge can create jump into if branches that make CFG irreducible for
   // HW that requires structurized CFG.
   bool EnableTailMerge = !MF.getTarget().requiresStructuredCFG() &&
-                         PassConfig->getEnableTailMerge();
+                         PassConfig->getEnableTailMerge() &&
----------------
mikhailramalho wrote:

In the failing tests, the branch folding pass is disabled here: 
https://github.com/llvm/llvm-project/blob/32c39092eab3a401d9d028c21f4707102fd70e32/llvm/lib/Target/SPIRV/SPIRVTargetMachine.cpp#L174

So by calling `createBranchFolderPass`, we don't check the disabled passed

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


More information about the llvm-commits mailing list