[llvm] [AMDGPU] Allow casts between the Global and Constant Addr Spaces in isValidAddrSpaceCast (PR #112493)

Fabian Ritter via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 17 23:51:22 PDT 2024


================
@@ -187,9 +187,12 @@ class GCNTTIImpl final : public BasicTTIImplBase<GCNTTIImpl> {
       }
       return false;
     }
-    if ((FromAS == AMDGPUAS::CONSTANT_ADDRESS_32BIT &&
-         ToAS == AMDGPUAS::CONSTANT_ADDRESS) ||
-        (FromAS == AMDGPUAS::CONSTANT_ADDRESS &&
+    if (FromAS != ToAS &&
+        (FromAS == AMDGPUAS::GLOBAL_ADDRESS ||
+         FromAS == AMDGPUAS::CONSTANT_ADDRESS ||
+         FromAS == AMDGPUAS::CONSTANT_ADDRESS_32BIT) &&
+        (ToAS == AMDGPUAS::GLOBAL_ADDRESS ||
+         ToAS == AMDGPUAS::CONSTANT_ADDRESS ||
          ToAS == AMDGPUAS::CONSTANT_ADDRESS_32BIT))
----------------
ritter-x2a wrote:

Adjusted in the most recent commit.

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


More information about the llvm-commits mailing list