[clang] [RISCV] Add -march string as Module metadata in IR. (PR #80760)

2024-02-06 Thread Alex Bradbury via cfe-commits
asb wrote: I agree that finding a generic cross-target solution to this problem is attractive...but I worry it will be hard and slow to proceed. It's possible the previous discussions just lacked someone following up with concrete patches, but I do worry we'd end up stuck in limbo vs starting

[clang] [RISCV] Add -march string as Module metadata in IR. (PR #80760)

2024-02-05 Thread Jessica Clarke via cfe-commits
jrtc27 wrote: My thoughts on this in the past have been: 1. target-abi should really be a target-independent thing we record; its meaning depends on the target, but the ABI exists throughout LLVM as a concept regardless of the target 2. module-level target features in general likely should be

[clang] [RISCV] Add -march string as Module metadata in IR. (PR #80760)

2024-02-05 Thread Craig Topper via cfe-commits
topperc wrote: > I'm surprised only 1 test file needed the metadata updated as a result of > this change. Maybe other tests are better about using regexes to hide the numbers? https://github.com/llvm/llvm-project/pull/80760 ___ cfe-commits mailing

[clang] [RISCV] Add -march string as Module metadata in IR. (PR #80760)

2024-02-05 Thread Paul Kirth via cfe-commits
https://github.com/ilovepi approved this pull request. Thank you for this. I expect this to be a big help w/ the various target features bugs we've seen in LTO builds. I'm surprised only 1 test file needed the metadata updated as a result of this change.

[clang] [RISCV] Add -march string as Module metadata in IR. (PR #80760)

2024-02-05 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-backend-risc-v Author: Craig Topper (topperc) Changes In an LTO build, we don't set the ELF attributes to indicate what extensions were compiled with. The target CPU/Attrs in RISCVTargetMachine do not get set for an LTO build. Each function gets a

[clang] [RISCV] Add -march string as Module metadata in IR. (PR #80760)

2024-02-05 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang @llvm/pr-subscribers-clang-codegen Author: Craig Topper (topperc) Changes In an LTO build, we don't set the ELF attributes to indicate what extensions were compiled with. The target CPU/Attrs in RISCVTargetMachine do not get set for an LTO

[clang] [RISCV] Add -march string as Module metadata in IR. (PR #80760)

2024-02-05 Thread Craig Topper via cfe-commits
https://github.com/topperc created https://github.com/llvm/llvm-project/pull/80760 In an LTO build, we don't set the ELF attributes to indicate what extensions were compiled with. The target CPU/Attrs in RISCVTargetMachine do not get set for an LTO build. Each function gets a