forked from OSchip/llvm-project
AMDGPU: Stop reporting is-noop addrspacecast for constant 32-bit
This will require something to cast. Before this would eliminate the cast, which would result in copies of $noreg. llvm-svn: 341803
This commit is contained in:
parent
09f00dcf69
commit
7f6dc597d3
|
@ -1120,8 +1120,7 @@ EVT SITargetLowering::getOptimalMemOpType(uint64_t Size, unsigned DstAlign,
|
||||||
static bool isFlatGlobalAddrSpace(unsigned AS) {
|
static bool isFlatGlobalAddrSpace(unsigned AS) {
|
||||||
return AS == AMDGPUAS::GLOBAL_ADDRESS ||
|
return AS == AMDGPUAS::GLOBAL_ADDRESS ||
|
||||||
AS == AMDGPUAS::FLAT_ADDRESS ||
|
AS == AMDGPUAS::FLAT_ADDRESS ||
|
||||||
AS == AMDGPUAS::CONSTANT_ADDRESS ||
|
AS == AMDGPUAS::CONSTANT_ADDRESS;
|
||||||
AS == AMDGPUAS::CONSTANT_ADDRESS_32BIT;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool SITargetLowering::isNoopAddrSpaceCast(unsigned SrcAS,
|
bool SITargetLowering::isNoopAddrSpaceCast(unsigned SrcAS,
|
||||||
|
|
|
@ -6,3 +6,10 @@ define amdgpu_kernel void @use_group_to_global_addrspacecast(i32 addrspace(3)* %
|
||||||
store volatile i32 0, i32 addrspace(1)* %stof
|
store volatile i32 0, i32 addrspace(1)* %stof
|
||||||
ret void
|
ret void
|
||||||
}
|
}
|
||||||
|
|
||||||
|
; ERROR: error: <unknown>:0:0: in function use_constant32bit_to_flat_addrspacecast void (i32 addrspace(6)*): invalid addrspacecast
|
||||||
|
define amdgpu_kernel void @use_constant32bit_to_flat_addrspacecast(i32 addrspace(6)* %ptr) #0 {
|
||||||
|
%stof = addrspacecast i32 addrspace(6)* %ptr to i32*
|
||||||
|
store volatile i32 7, i32* %stof
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue