[llvm] [AMDGPU] Allow casts between the Global and Constant Addr Spaces in isValidAddrSpaceCast (PR #112493)
Matt Arsenault via llvm-commits
llvm-commits at lists.llvm.org
Wed Oct 16 01:15:07 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))
----------------
arsenm wrote:
It's a stylistic choice, whatever comes out simpler
https://github.com/llvm/llvm-project/pull/112493
More information about the llvm-commits
mailing list