Skip to content

[AMDGPU] Simplify GCNTTIImpl::isValidAddrSpaceCast. NFCI. #137986

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 1, 2025

Conversation

jayfoad
Copy link
Contributor

@jayfoad jayfoad commented Apr 30, 2025

This just removes some code that references specific address spaces.

This just removes some code that references specific address spaces.
@llvmbot
Copy link
Member

llvmbot commented Apr 30, 2025

@llvm/pr-subscribers-backend-amdgpu

Author: Jay Foad (jayfoad)

Changes

This just removes some code that references specific address spaces.


Full diff: https://github.com/llvm/llvm-project/pull/137986.diff

1 Files Affected:

  • (modified) llvm/lib/Target/AMDGPU/AMDGPUTargetTransformInfo.h (+2-14)
diff --git a/llvm/lib/Target/AMDGPU/AMDGPUTargetTransformInfo.h b/llvm/lib/Target/AMDGPU/AMDGPUTargetTransformInfo.h
index f6f7bd4bfcf5b..c4520f8cd3311 100644
--- a/llvm/lib/Target/AMDGPU/AMDGPUTargetTransformInfo.h
+++ b/llvm/lib/Target/AMDGPU/AMDGPUTargetTransformInfo.h
@@ -182,20 +182,8 @@ class GCNTTIImpl final : public BasicTTIImplBase<GCNTTIImpl> {
     if (FromAS == ToAS)
       return false;
 
-    if (FromAS == AMDGPUAS::FLAT_ADDRESS)
-      return AMDGPU::isExtendedGlobalAddrSpace(ToAS) ||
-             ToAS == AMDGPUAS::LOCAL_ADDRESS ||
-             ToAS == AMDGPUAS::PRIVATE_ADDRESS;
-
-    if (AMDGPU::isExtendedGlobalAddrSpace(FromAS))
-      return AMDGPU::isFlatGlobalAddrSpace(ToAS) ||
-             ToAS == AMDGPUAS::CONSTANT_ADDRESS_32BIT;
-
-    if (FromAS == AMDGPUAS::LOCAL_ADDRESS ||
-        FromAS == AMDGPUAS::PRIVATE_ADDRESS)
-      return ToAS == AMDGPUAS::FLAT_ADDRESS;
-
-    return false;
+    // Casts between any aliasing address spaces are valid.
+    return AMDGPU::addrspacesMayAlias(FromAS, ToAS);
   }
 
   bool addrspacesMayAlias(unsigned AS0, unsigned AS1) const override {

@jayfoad jayfoad merged commit c2bec64 into llvm:main May 1, 2025
13 checks passed
@jayfoad jayfoad deleted the simplify-isvalidaddrspacecast branch May 1, 2025 19:19
IanWood1 pushed a commit to IanWood1/llvm-project that referenced this pull request May 6, 2025
This just removes some code that references specific address spaces.
IanWood1 pushed a commit to IanWood1/llvm-project that referenced this pull request May 6, 2025
This just removes some code that references specific address spaces.
IanWood1 pushed a commit to IanWood1/llvm-project that referenced this pull request May 6, 2025
This just removes some code that references specific address spaces.
GeorgeARM pushed a commit to GeorgeARM/llvm-project that referenced this pull request May 7, 2025
This just removes some code that references specific address spaces.
Ankur-0429 pushed a commit to Ankur-0429/llvm-project that referenced this pull request May 9, 2025
This just removes some code that references specific address spaces.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants