[llvm] [llvm] Fix the MCSubtargetInfo used for module-level assembly. (PR #97685)

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 5 11:46:35 PDT 2024


https://github.com/MaskRay requested changes to this pull request.

Request changes since the ABI will change. My summary:

<https://github.com/llvm/llvm-project/pull/96721> implemented a strategy by storing the target features in `LLVMContext`, which is not serialized.
`Function::createWithDefaultAttr` will load the target features from `LLVMContext`.

While 96721 works well, there is a drawback that the generate module from the LTO pre-link compilation does not contain sufficient information.
Running `opt` without the correct target features would not mimick Clang .
To address this drawback, we can use module flags metadata that is dropped during merging.


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


More information about the llvm-commits mailing list