[llvm] [RISCV] Prefer VLS over VLA if costs are equal (PR #100564)

Pengcheng Wang via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 26 01:11:31 PDT 2024


wangpc-pp wrote:

> I would prefer this not land without some evidence of profitability on at least some hardware.

Compile TSVC with `clang -O2 -mcpu=spacemit-x60 -Xclang -target-feature -Xclang +use-fixed-over-scalable-if-equal-cost` and test it on Spacemit K1 board, we can see some improvments (we can reduce 1 scalar instruction in some loops like `s121`).

> If the runtime VLEN is greater than 128 the scalable code will be able to process more elements per iteration.

I was thinking that we are just compiling for one CPU with `-mcpu`.

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


More information about the llvm-commits mailing list