[llvm] e24dc34 - AMDGPU: Fix asserting in DAG kernel argument lowering on v6i32 (#100528)
via llvm-commits
llvm-commits at lists.llvm.org
Thu Jul 25 03:03:31 PDT 2024
Author: Matt Arsenault
Date: 2024-07-25T14:03:28+04:00
New Revision: e24dc34aa085b9e8d3ea58cc5f59f80bc4c7cdb4
URL: https://github.com/llvm/llvm-project/commit/e24dc34aa085b9e8d3ea58cc5f59f80bc4c7cdb4
DIFF: https://github.com/llvm/llvm-project/commit/e24dc34aa085b9e8d3ea58cc5f59f80bc4c7cdb4.diff
LOG: AMDGPU: Fix asserting in DAG kernel argument lowering on v6i32 (#100528)
Remove this pointless assertion for the number of vector elements.
Added:
Modified:
llvm/lib/Target/AMDGPU/AMDGPUISelLowering.cpp
llvm/test/CodeGen/AMDGPU/kernel-argument-dag-lowering.ll
Removed:
################################################################################
diff --git a/llvm/lib/Target/AMDGPU/AMDGPUISelLowering.cpp b/llvm/lib/Target/AMDGPU/AMDGPUISelLowering.cpp
index ec386000302f1..2ad91de566323 100644
--- a/llvm/lib/Target/AMDGPU/AMDGPUISelLowering.cpp
+++ b/llvm/lib/Target/AMDGPU/AMDGPUISelLowering.cpp
@@ -1245,10 +1245,6 @@ void AMDGPUTargetLowering::analyzeFormalArgumentsCompute(
// Round up vec3/vec5 argument.
if (MemVT.isVector() && !MemVT.isPow2VectorType()) {
- assert(MemVT.getVectorNumElements() == 3 ||
- MemVT.getVectorNumElements() == 5 ||
- (MemVT.getVectorNumElements() >= 9 &&
- MemVT.getVectorNumElements() <= 12));
MemVT = MemVT.getPow2VectorType(State.getContext());
} else if (!MemVT.isSimple() && !MemVT.isVector()) {
MemVT = MemVT.getRoundIntegerType(State.getContext());
diff --git a/llvm/test/CodeGen/AMDGPU/kernel-argument-dag-lowering.ll b/llvm/test/CodeGen/AMDGPU/kernel-argument-dag-lowering.ll
index f74f9a8f2bdd8..1a0aa09e2e40a 100644
--- a/llvm/test/CodeGen/AMDGPU/kernel-argument-dag-lowering.ll
+++ b/llvm/test/CodeGen/AMDGPU/kernel-argument-dag-lowering.ll
@@ -27,6 +27,48 @@ entry:
ret void
}
+; FUNC-LABEL: {{^}}v5i8_arg:
+; GCN: s_load_dwordx2 s[0:1], s[8:9], 0x0
+define amdgpu_kernel void @v5i8_arg(<5 x i8> %in) nounwind {
+ store <5 x i8> %in, ptr addrspace(1) null
+ ret void
+}
+
+; FUNC-LABEL: {{^}}v6i8_arg:
+; GCN: s_load_dwordx2 s[0:1], s[8:9], 0x0
+define amdgpu_kernel void @v6i8_arg(<6 x i8> %in) nounwind {
+ store <6 x i8> %in, ptr addrspace(1) null
+ ret void
+}
+
+; FUNC-LABEL: {{^}}v5i16_arg:
+; GCN: s_load_dwordx4 s[0:3], s[8:9], 0x0
+define amdgpu_kernel void @v5i16_arg(<5 x i16> %in) nounwind {
+ store <5 x i16> %in, ptr addrspace(1) null
+ ret void
+}
+
+; FUNC-LABEL: {{^}}v6i16_arg:
+; GCN-DAG: s_load_dwordx4 s[0:3], s[8:9], 0x0
+define amdgpu_kernel void @v6i16_arg(<6 x i16> %in) nounwind {
+ store <6 x i16> %in, ptr addrspace(1) null
+ ret void
+}
+
+; FUNC-LABEL: {{^}}v5i32_arg:
+; GCN: s_load_dwordx8 s[0:7], s[8:9], 0x0
+define amdgpu_kernel void @v5i32_arg(<5 x i32> %in) nounwind {
+ store <5 x i32> %in, ptr addrspace(1) null
+ ret void
+}
+
+; FUNC-LABEL: {{^}}v6i32_arg:
+; GCN: s_load_dwordx8 s[0:7], s[8:9], 0x0
+define amdgpu_kernel void @v6i32_arg(<6 x i32> %in) nounwind {
+ store <6 x i32> %in, ptr addrspace(1) null
+ ret void
+}
+
; FUNC-LABEL: {{^}}i65_arg:
; HSA-VI: s_load_dwordx4 s{{\[[0-9]+:[0-9]+\]}}, s[8:9], 0x0
More information about the llvm-commits
mailing list