[all-commits] [llvm/llvm-project] 046bd5: [RISCV] Set CostPerUse to 1 only when optimizing f...

Pengcheng Wang via All-commits all-commits at lists.llvm.org
Thu Jun 11 02:14:17 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 046bd54d17a057fdf344889f8e4b1b8e6d850dd7
      https://github.com/llvm/llvm-project/commit/046bd54d17a057fdf344889f8e4b1b8e6d850dd7
  Author: Pengcheng Wang <wangpengcheng.pp at bytedance.com>
  Date:   2026-06-11 (Thu, 11 Jun 2026)

  Changed paths:
    M llvm/lib/Target/RISCV/RISCVRegisterInfo.cpp
    M llvm/test/CodeGen/RISCV/add-before-shl.ll
    M llvm/test/CodeGen/RISCV/callee-saved-gprs.ll
    M llvm/test/CodeGen/RISCV/fold-addi-loadstore.ll
    M llvm/test/CodeGen/RISCV/machine-pipeliner.ll
    M llvm/test/CodeGen/RISCV/nontemporal.ll
    M llvm/test/CodeGen/RISCV/push-pop-popret.ll
    M llvm/test/CodeGen/RISCV/qci-interrupt-attr-fpr.ll
    M llvm/test/CodeGen/RISCV/qci-interrupt-attr.ll
    M llvm/test/CodeGen/RISCV/rvv/fixed-vectors-int-buildvec.ll
    M llvm/test/CodeGen/RISCV/rvv/nontemporal-vp-scalable.ll
    M llvm/test/CodeGen/RISCV/rvv/pr95865.ll
    M llvm/test/CodeGen/RISCV/rvv/vsetvli-insert-crossbb.ll
    M llvm/test/CodeGen/RISCV/rvv/vxrm-insert-out-of-loop.ll
    M llvm/test/CodeGen/RISCV/select-cc.ll
    M llvm/test/CodeGen/RISCV/xqccmp-callee-saved-gprs.ll
    M llvm/test/CodeGen/RISCV/xqccmp-push-pop-popret.ll

  Log Message:
  -----------
  [RISCV] Set CostPerUse to 1 only when optimizing for size (#201501)

We saw some regressions because of bad RAs as the cost of registers
beyond x8-x15 are bigger. This is why `DisableCostPerUse` was added
in https://github.com/llvm/llvm-project/issues/83320.

In this PR, we change it to set `CostPerUse=1` only when optimizing
for size.

Code size increases less than 0.1% in llvm-test-suite.



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