[llvm] [RISCV] Collect function features in AsmPrinter before emission (#76231) (PR #76437)
Craig Topper via llvm-commits
llvm-commits at lists.llvm.org
Fri Dec 29 09:57:29 PST 2023
topperc wrote:
> For example, if the user provides such a command line we will get I small one representing the minimal set (supposing that the user provides a minimal `arch`), although if the user provides just `-mcpu` option, the frontend will need to infer the `arch`, and, as I see from multilib selection it can be a really a long `arch` string that appends all features of the chosen core.
The frontend already turns the -mcpu into an -march. See `riscv::getRISCVArch` in clang/lib/Driver/ToolChains/Arch/RISCV.cpp. Why is it a problem that it's long?
> About taking the union, the last version of this PR includes it, by removing incompatible feature combinations. It means that the generated Elf attribute will be compatible with all functions, and the functions will also have the mapping symbols to specific and incompatible features concerning other functions.
Doesn't it change the meaning of the ELF attribute for some uses? What if the only functions in the program that use vector instructions checked hwprobe first? Won't you still put vector in the ELF attributes? What if the loader checks the ELF attributes on a system without vector and prevents the program from loading?
https://github.com/llvm/llvm-project/pull/76437
More information about the llvm-commits
mailing list