[clang] [llvm] [RISCV] Remove B and Zbc extension from Andes series cpus. (PR #144022)

Sam Elliott via llvm-commits llvm-commits at lists.llvm.org
Sun Jun 15 12:31:56 PDT 2025


lenary wrote:

> > Not related to this PR, but I'd like to raise the question here:
> > For configurable cores, what is the best way to specify the features? `-mcpu` is meant to support the base configuration, but how can we specify the additional optional extensions? Apparently, failing back to `-march` is silly.
> > My thought is: can we support `-march/-mcpu` where the values can be `{cpu}(_ext)*`? Will such use be problematic?
> 
> Unfortunately, we have to suggest our users to specify both `-march` and `-mcpu` when their processor includes additional optional extensions. Ideally, we hope that code generated using `-mcpu` alone would always be compatible with processors that have varying configurations.

This is the same trade-off that I would choose, but I understand why others have gone a different way.

My hope would be that the combination of `-march=` and `-mtune=` would be equivalent to `-mcpu=`, so if you added more features to `-march=`, you'd still get the code generation you want (scheduling, optimisations, etc) but also the additional instructions that you asked for. I think we've worked out how to model this well in the RISC-V backend, but I haven't examined how `-mtune=` is treated fully.


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


More information about the llvm-commits mailing list