[llvm] [llvm][AArch64] Autoupgrade function attributes from Module attributes. (PR #80640)

Nick Desaulniers via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 21 13:53:54 PST 2024


nickdesaulniers wrote:

Patch LGTM but I wanted to follow up on [the point about clang code gen](https://github.com/llvm/llvm-project/pull/80642#issuecomment-1942098974) from the other thread.

>> Also, I'm kind of surprised you didn't have to change anything in clang codegen of LLVM IR. Shouldn't clang now be generating fn attrs rather than module attrs?
> Clang can't really do much here as we add more functions to the module during later passes ( c++ exception handler, sanitisers especially). So the right thing is to derive the attributes from the module flag.

Right, I do recall issues with functions that have been synthesized by the compiler lacking certain function attributes...I thought we had another way of solving those (that was not AutoUpgrade).  I think that's the point of `llvm::Function::createWithDefaultAttr`. Can you use that instead?

> Autoupgrade now do this at the last moment before the functions merged into the common module.

Does auto upgrade run as a pass in the default pipelines?  I thought it was just for helping folks move from one version of IR to another (for .bc or .ll files).

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


More information about the llvm-commits mailing list