[llvm] [RISCV] Add TuneJumpIsExpensive (PR #191374)

Luke Lau via llvm-commits llvm-commits at lists.llvm.org
Sat Apr 11 07:59:43 PDT 2026


lukel97 wrote:

> However, it appears to be applied as a global heuristic. I’m a bit concerned that it may be overly aggressive in some cases, as it moves away from short-circuit behavior—evaluating all conditions before branching, even when an earlier condition could already determine the outcome.

I think the best of both worlds would be that `TargetLoweringInfo::isJumpExpensive` would return an integer for the maximum number of branches to allow, similar to `-riscv-cbc-max-branch` in #191158, and SelectionDAGBuilder/`CodeGenPrepare::splitBranchCondition` would only emit said maximum number.

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


More information about the llvm-commits mailing list