Skip to content

Commit e6b33b3

Browse files
arsenmyuxuanchen1997
authored andcommitted
AMDGPU: Fix asserting in DAG kernel argument lowering on v6i32 (#100528)
Summary: Remove this pointless assertion for the number of vector elements. Test Plan: Reviewers: Subscribers: Tasks: Tags: Differential Revision: https://phabricator.intern.facebook.com/D60250774
1 parent cf1707f commit e6b33b3

File tree

2 files changed

+42
-4
lines changed

2 files changed

+42
-4
lines changed

llvm/lib/Target/AMDGPU/AMDGPUISelLowering.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1245,10 +1245,6 @@ void AMDGPUTargetLowering::analyzeFormalArgumentsCompute(
12451245

12461246
// Round up vec3/vec5 argument.
12471247
if (MemVT.isVector() && !MemVT.isPow2VectorType()) {
1248-
assert(MemVT.getVectorNumElements() == 3 ||
1249-
MemVT.getVectorNumElements() == 5 ||
1250-
(MemVT.getVectorNumElements() >= 9 &&
1251-
MemVT.getVectorNumElements() <= 12));
12521248
MemVT = MemVT.getPow2VectorType(State.getContext());
12531249
} else if (!MemVT.isSimple() && !MemVT.isVector()) {
12541250
MemVT = MemVT.getRoundIntegerType(State.getContext());

llvm/test/CodeGen/AMDGPU/kernel-argument-dag-lowering.ll

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,48 @@ entry:
2727
ret void
2828
}
2929

30+
; FUNC-LABEL: {{^}}v5i8_arg:
31+
; GCN: s_load_dwordx2 s[0:1], s[8:9], 0x0
32+
define amdgpu_kernel void @v5i8_arg(<5 x i8> %in) nounwind {
33+
store <5 x i8> %in, ptr addrspace(1) null
34+
ret void
35+
}
36+
37+
; FUNC-LABEL: {{^}}v6i8_arg:
38+
; GCN: s_load_dwordx2 s[0:1], s[8:9], 0x0
39+
define amdgpu_kernel void @v6i8_arg(<6 x i8> %in) nounwind {
40+
store <6 x i8> %in, ptr addrspace(1) null
41+
ret void
42+
}
43+
44+
; FUNC-LABEL: {{^}}v5i16_arg:
45+
; GCN: s_load_dwordx4 s[0:3], s[8:9], 0x0
46+
define amdgpu_kernel void @v5i16_arg(<5 x i16> %in) nounwind {
47+
store <5 x i16> %in, ptr addrspace(1) null
48+
ret void
49+
}
50+
51+
; FUNC-LABEL: {{^}}v6i16_arg:
52+
; GCN-DAG: s_load_dwordx4 s[0:3], s[8:9], 0x0
53+
define amdgpu_kernel void @v6i16_arg(<6 x i16> %in) nounwind {
54+
store <6 x i16> %in, ptr addrspace(1) null
55+
ret void
56+
}
57+
58+
; FUNC-LABEL: {{^}}v5i32_arg:
59+
; GCN: s_load_dwordx8 s[0:7], s[8:9], 0x0
60+
define amdgpu_kernel void @v5i32_arg(<5 x i32> %in) nounwind {
61+
store <5 x i32> %in, ptr addrspace(1) null
62+
ret void
63+
}
64+
65+
; FUNC-LABEL: {{^}}v6i32_arg:
66+
; GCN: s_load_dwordx8 s[0:7], s[8:9], 0x0
67+
define amdgpu_kernel void @v6i32_arg(<6 x i32> %in) nounwind {
68+
store <6 x i32> %in, ptr addrspace(1) null
69+
ret void
70+
}
71+
3072
; FUNC-LABEL: {{^}}i65_arg:
3173
; HSA-VI: s_load_dwordx4 s{{\[[0-9]+:[0-9]+\]}}, s[8:9], 0x0
3274

0 commit comments

Comments
 (0)