[llvm] r341803 - AMDGPU: Stop reporting is-noop addrspacecast for constant 32-bit
Matt Arsenault via llvm-commits
llvm-commits at lists.llvm.org
Mon Sep 10 04:59:27 PDT 2018
Author: arsenm
Date: Mon Sep 10 04:59:27 2018
New Revision: 341803
URL: http://llvm.org/viewvc/llvm-project?rev=341803&view=rev
Log:
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.
Modified:
llvm/trunk/lib/Target/AMDGPU/SIISelLowering.cpp
llvm/trunk/test/CodeGen/AMDGPU/invalid-addrspacecast.ll
Modified: llvm/trunk/lib/Target/AMDGPU/SIISelLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AMDGPU/SIISelLowering.cpp?rev=341803&r1=341802&r2=341803&view=diff
==============================================================================
--- llvm/trunk/lib/Target/AMDGPU/SIISelLowering.cpp (original)
+++ llvm/trunk/lib/Target/AMDGPU/SIISelLowering.cpp Mon Sep 10 04:59:27 2018
@@ -1120,8 +1120,7 @@ EVT SITargetLowering::getOptimalMemOpTyp
static bool isFlatGlobalAddrSpace(unsigned AS) {
return AS == AMDGPUAS::GLOBAL_ADDRESS ||
AS == AMDGPUAS::FLAT_ADDRESS ||
- AS == AMDGPUAS::CONSTANT_ADDRESS ||
- AS == AMDGPUAS::CONSTANT_ADDRESS_32BIT;
+ AS == AMDGPUAS::CONSTANT_ADDRESS;
}
bool SITargetLowering::isNoopAddrSpaceCast(unsigned SrcAS,
Modified: llvm/trunk/test/CodeGen/AMDGPU/invalid-addrspacecast.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/AMDGPU/invalid-addrspacecast.ll?rev=341803&r1=341802&r2=341803&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/AMDGPU/invalid-addrspacecast.ll (original)
+++ llvm/trunk/test/CodeGen/AMDGPU/invalid-addrspacecast.ll Mon Sep 10 04:59:27 2018
@@ -6,3 +6,10 @@ define amdgpu_kernel void @use_group_to_
store volatile i32 0, i32 addrspace(1)* %stof
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
+}
More information about the llvm-commits
mailing list