[llvm] [ARM] Recognize abi tag module flags (PR #161306)

Peter Smith via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 10 10:13:44 PDT 2025


smithp35 wrote:

The code changes look good to me for the proposed change. I'll be away for a couple of weeks so I'll tag my colleague that reviewed the clang patch.

I'm still a bit unsure about what to do in the LTO case.

What I'm concerned about is something like:
clang -flto (non-default options one or more of these flags) src1.c
clang -flto (non-default options one or more of these flags) src2.c
clang -flto src1.o src2.o -o output.exe (module flags get defaults)

We've been asked to fix problems like this with architecture flags as this does occur in projects that separate their compile and link flags.

We used to pick up the build attributes from the functions if they were consistent. Now it looks like we'll overwrite them with the default module flags.

In the linked PR https://github.com/llvm/llvm-project/pull/161106 you mention that UnsafeFPMath and related flags were disappearing. I wasn't sure what that referred to. If the per function attributes are disappearing and the module flags are all we have then there's not much more we can do, perhaps making sure we release note it so that users can make sure they add the flags to their link line.

Alternatively it may be worth looking at all the functions, and if they are all consistent, but different from the module flags then use the function flags.


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


More information about the llvm-commits mailing list