[all-commits] [llvm/llvm-project] 95f1ea: [RISCV] Add getJumpConditionMergingParams to suppo...

Pengcheng Wang via All-commits all-commits at lists.llvm.org
Mon Jul 13 02:35:54 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 95f1eab03f35545eb308246376541a7150a7a4e4
      https://github.com/llvm/llvm-project/commit/95f1eab03f35545eb308246376541a7150a7a4e4
  Author: Pengcheng Wang <wangpengcheng.pp at bytedance.com>
  Date:   2026-07-13 (Mon, 13 Jul 2026)

  Changed paths:
    M llvm/include/llvm/CodeGen/TargetLowering.h
    M llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
    M llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
    M llvm/lib/Target/AArch64/AArch64ISelLowering.h
    M llvm/lib/Target/RISCV/RISCVISelLowering.cpp
    M llvm/lib/Target/RISCV/RISCVISelLowering.h
    M llvm/lib/Target/SystemZ/SystemZISelLowering.cpp
    M llvm/lib/Target/SystemZ/SystemZISelLowering.h
    M llvm/lib/Target/X86/X86ISelLowering.cpp
    M llvm/lib/Target/X86/X86ISelLowering.h
    M llvm/test/CodeGen/RISCV/double-previous-failure.ll
    A llvm/test/CodeGen/RISCV/jump-cond-merging-optsize.ll
    M llvm/test/CodeGen/RISCV/jump-is-expensive.ll
    M llvm/test/CodeGen/RISCV/or-is-add.ll
    M llvm/test/CodeGen/RISCV/rvv/pr93587.ll
    M llvm/test/CodeGen/RISCV/rvv/vcpop-shl-zext-opt.ll
    M llvm/test/CodeGen/RISCV/select-and.ll
    M llvm/test/CodeGen/RISCV/select-or.ll
    M llvm/test/CodeGen/RISCV/setcc-logic.ll

  Log Message:
  -----------
  [RISCV] Add getJumpConditionMergingParams to support branch condition merging (#206897)

Override `getJumpConditionMergingParams` so that
`shouldKeepJumpConditionsTogether`
can decide whether to keep `br (and/or cond1, cond2)` merged into a
single
branch or split it into two branches, based on a configurable cost
threshold.

Previously RISC-V used the default cost `{-1, -1, -1}`, which always
split
the conditions. Now it returns a base cost calculated from
`MispredictPenalty`
(via scaling it down by an assumed misprediction rate 25%).

These values are controllable via
`riscv-br-merging-base-cost/-likely-bias/-unlikely-bias`.

This is another approach to #191158 when `TuneJumpIsExpensive` is not
set.



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