[clang] [llvm] [AMDGPU] Infer amdgpu-no-flat-scratch-init attribute in AMDGPUAttributor (PR #94647)

Matt Arsenault via cfe-commits cfe-commits at lists.llvm.org
Sun Sep 15 06:03:19 PDT 2024


================
@@ -434,6 +434,15 @@ struct AAAMDAttributesFunction : public AAAMDAttributes {
       indicatePessimisticFixpoint();
       return;
     }
+
+    for (Instruction &I : instructions(F)) {
+      if (isa<AddrSpaceCastInst>(I) &&
----------------
arsenm wrote:

For a nightmare of an edge case, addrspacecasts from private to flat can exist somewhere in constant expressions. For now, as long as addrspace(5) globals are forbidden, this would only be valid with literal addresses. 

I'm not sure how defined we should consider that case.

But if you follow along with the queue pointer handling, it will work. It already has to handle the 3->0 case in constant expressions 

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


More information about the cfe-commits mailing list