[llvm] [BranchFolding] Add an option to tail merge only bbs without successors (PR #101969)
Juan Manuel Martinez CaamaƱo via llvm-commits
llvm-commits at lists.llvm.org
Mon Oct 14 08:43:36 PDT 2024
================
@@ -1035,6 +1040,9 @@ bool BranchFolder::TailMergeBlocks(MachineFunction &MF) {
if (MergePotentials.size() >= 2)
MadeChange |= TryTailMergeBlocks(nullptr, nullptr, MinCommonTailLength);
+ if (TailMergeOnlyBBsWithoutSucc)
----------------
jmmartinez wrote:
Ok, so if I understand this would optimize for performance in your target and not for code-size.
In that case, have you thought about making the `enable-tail-merge` (and the value in the constructor of `BranchFolder`) into an `enum` covering your case ?
I'd not be against a target hook returning `true` if "unconditional-jumps-are-expensive" that helps control this behavior.
https://github.com/llvm/llvm-project/pull/101969
More information about the llvm-commits
mailing list