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

Jun Wang via cfe-commits cfe-commits at lists.llvm.org
Wed Sep 18 17:41:19 PDT 2024


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

@arsenm Following constants to see if they contain addrSpaceCast is now done. An example is: `store i32 7, ptr addrspace(3) addrspacecast (ptr addrspace(5) null to ptr addrspace(3))`. 
However, I'm not sure it's required or even correct. For the above example, opt with -O2 would optimize away the addrspacecast, and the result would be the opposite.

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


More information about the cfe-commits mailing list