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
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 2 additions & 14 deletions llvm/lib/Target/AMDGPU/AMDGPUTargetTransformInfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down