[llvm] [RISCV] Introduce a new tune feature string syntax and its parser (PR #168160)
Min-Yih Hsu via llvm-commits
llvm-commits at lists.llvm.org
Tue Dec 2 14:32:16 PST 2025
mshockwave wrote:
Have a discussion with @topperc on this comment: https://github.com/riscv-non-isa/riscv-toolchain-conventions/pull/122#discussion_r2558108285
That is, whether some subtarget features are just not suitable for using as a tuning directive here. Take the DLEN factor of 2 as an example, right now some scheduling models do factor DLEN into their latency or occupancy numbers. But for those models, DLEN is effectively hard-coded. Meaning latency & occupancy could not be adjusted with arbitrary DLEN values. So if we say something like `-mtune=sifive-x280:no-dlen-factor-2` there will be no effect on the scheduling model. The only other place `dlen-factor-2` is used is the TTI cost model for calculating LMUL cost . But since we cannot adjust the scheduling model, adjusting _only_ the TTI cost model through `-mtune=sifive-x280:no-dlen-factor-2` would cause mismatching between the LLVM IR instruction cost and the machine instruction schedule. In other words, scheduling model and TTI cost model are locked together in this case, we either adjust both of them or we don't. And since we cannot adjust both, it doesn't make sense to apply `dlen-factor-2/no-dlen-factor-2` in the new `-mtune` string.
Similar thing happens on `log-vrgather` too: it's used by both scheduling model and TTI cost model, and the scheduling model that goes with this subtarget feature already factors it into their latency of `vrgather.vv`. Therefore, I think it makes more sense to remove these two subtarget features from the list of supported tune directives.
That being said, in the future if any of the scheduling model is able to adjust their DLEN according to `dlen-factor-2`, we can definitely add this back into the list, as both the scheduling model and TTI cost model will be in sync.
https://github.com/llvm/llvm-project/pull/168160
More information about the llvm-commits
mailing list