[all-commits] [llvm/llvm-project] e67f93: [profcheck] Fix profle metatdata propagation for L...

Jin Huang via All-commits all-commits at lists.llvm.org
Fri Jan 23 10:29:43 PST 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: e67f934c12bf2a3dd6ed90b212ff40a96a074b3f
      https://github.com/llvm/llvm-project/commit/e67f934c12bf2a3dd6ed90b212ff40a96a074b3f
  Author: Jin Huang <jinhuang1102 at gmail.com>
  Date:   2026-01-23 (Fri, 23 Jan 2026)

  Changed paths:
    M llvm/include/llvm/IR/ProfDataUtils.h
    M llvm/lib/IR/ProfDataUtils.cpp
    M llvm/lib/Transforms/Utils/IntegerDivision.cpp
    M llvm/test/CodeGen/RISCV/idiv_large.ll
    M llvm/test/CodeGen/X86/div-rem-pair-recomposition-signed.ll
    M llvm/test/CodeGen/X86/div-rem-pair-recomposition-unsigned.ll
    M llvm/test/CodeGen/X86/pr38539.ll
    M llvm/test/Transforms/ExpandIRInsts/X86/sdiv129.ll
    M llvm/test/Transforms/ExpandIRInsts/X86/srem129.ll
    M llvm/test/Transforms/ExpandIRInsts/X86/udiv129.ll
    M llvm/test/Transforms/ExpandIRInsts/X86/urem129.ll
    M llvm/test/Transforms/ExpandIRInsts/X86/vector.ll

  Log Message:
  -----------
  [profcheck] Fix profle metatdata propagation for Large Integer operations (#175862)

This PR improves the propagation of profile metadata within the
ExpandIRInsts pass. When lowering large integer division operations, the
pass now ensures that branch weights are correctly attached to the
generated control flow, preventing the loss of profile data during IR
expansion.

This PR improves signed and unsigned division/remainder for non-native
bit widths (e.g., `sdiv/udiv i129`, `srem/urem i129`) and implemented
Heuristic-Based Branch Weights labeling using established heuristics for
edge cases e.g., `Division-by-zero guards` and `Magnitude comparisons
between dividends and divisors`.

It also adds detailed comments within the expansion logic to explain the
rationale behind specific branch weight choices and the underlying
mathematical invariants.

Please refer to the implementation details in the source code for the
specific branch weight values and the logic governing their application.

Co-authored-by: Jonas Devlieghere <jonas at devlieghere.com>



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list