[llvm] [MergeFunctions] Preserve instruction-level profile metadata during merging (PR #208009)

Alok Kumar Sharma via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 9 23:58:39 PDT 2026


================

----------------
alokkrsharma wrote:

Fair point — the original test tries to cover too much in one file, and the naming doesn't make the intent obvious.

I'll split it into three focused tests:

merge-functions-branch-weights.ll
merge-functions-select-weights.ll
merge-functions-value-profile.ll
Each will have a short header explaining that FunctionComparator only considers functions equal when their CFG and instruction order match, which is what lets MergeFunctions walk them in lockstep and merge per-instruction metadata. I'll also use clearer case names (br_both/br_one, vp_both/vp_kind, etc.).

It should be much easier to follow — let me know if you'd like any cases split further.

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


More information about the llvm-commits mailing list