[clang] [llvm] CodeGen, IR: Add target-{cpu,features} attributes to functions created via createWithDefaultAttr(). (PR #96721)

Eli Friedman via cfe-commits cfe-commits at lists.llvm.org
Tue Jun 25 21:27:29 PDT 2024


efriedma-quic wrote:

I don't think I like this approach:

- This seems like an easy way to unintentionally pass state between different compilations.
- It seems very easy to try to use this API during LTO, and have it do nothing.
- I'm pretty sure this breaks existing workflows involving AMDGPUCtorDtorLowering/NVPTXCtorDtorLowering.

And please don't merge changes to core IR datastructures less than an hour after you post the patch.  Please revert and start a Discourse discussion so we can discuss the right direction here.

Off the top of my head, it might make sense to pass the relevant attributes as arguments to the constructor for the relevant IR passes.

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


More information about the cfe-commits mailing list