[llvm] [RISCV] Prefix option names with riscv-, turn disable- to positive options (PR #228922)
Fangrui Song via llvm-commits
llvm-commits at lists.llvm.org
Mon Oct 5 21:21:09 PDT 2026
MaskRay wrote:
> Thanks for the patch! One small naming concern: with the `disable-/enable-` prefix gone, it's no longer clear from the flag name itself that whether it a boolean option or not. For example, `-riscv-cost-per-use` and `-riscv-mips-load-store-pairs` read like numeric values especially when read next to real value options such as `-riscv-zilsd-max-reschedule-distance` and `-riscv-sched-load-latency`.
>
> Since any flag of type `enable-foo-*` would get mapped to `enable_foo_*`, will it be ok to preserve the `enable` prefix in the flag names? This will still avoid the double negatives and will keep the boolean flags obvious from their names
I'd keep the bare names. In llc -help-hidden and opt -help-hidden, 1360 of the 1808 boolean options (75%) already have no `enable`/`disable` in their name: `-riscv-use-aa`, `-riscv-select-opt`, `-riscv-no-aliases` here, and most x86-, hexagon-, amdgpu- and polly- booleans (33/37, 45/49, 60/80, 89/95). -help-hidden already distinguishes the two kinds: `--riscv-zilsd-max-reschedule-distance=<uint>` shows a value, while a boolean prints just `--riscv-use-aa`.
https://github.com/llvm/llvm-project/pull/228922
More information about the llvm-commits
mailing list