1 ; RUN: llc < %s -mtriple=amdgcn-amd-amdhsa -mcpu=gfx900 -start-before=amdgpu-isel -stop-after=amdgpu-isel -verify-machineinstrs | FileCheck %s --check-prefixes=CHECK
3 ; This caused failure in infinite cycle in Selection DAG (combine) due to missing insert_subvector.
5 ; CHECK-LABEL: name: test1
6 ; CHECK: GLOBAL_LOAD_DWORDX4
7 ; CHECK: GLOBAL_LOAD_DWORDX4
8 ; CHECK: GLOBAL_STORE_DWORDX4
9 define protected amdgpu_kernel void @test1() local_unnamed_addr !kernel_arg_addr_space !0 !kernel_arg_access_qual !1 !kernel_arg_type !2 !kernel_arg_base_type !2 !kernel_arg_type_qual !3 !kernel_arg_name !4 {
11 %tmp = load <3 x i64>, <3 x i64> addrspace(4)* undef, align 16, !invariant.load !5
12 %srcA.load2 = extractelement <3 x i64> %tmp, i32 0
13 %tmp1 = inttoptr i64 %srcA.load2 to double addrspace(1)*
14 %tmp2 = getelementptr inbounds double, double addrspace(1)* %tmp1, i64 undef
15 %tmp3 = bitcast double addrspace(1)* %tmp2 to <3 x double> addrspace(1)*
16 %tmp4 = load <3 x double>, <3 x double> addrspace(1)* %tmp3, align 8, !tbaa !6
17 %tmp5 = extractelement <3 x double> %tmp4, i32 1
18 %tmp6 = insertelement <3 x double> undef, double %tmp5, i32 1
19 %tmp7 = insertelement <3 x double> %tmp6, double undef, i32 2
20 %tmp8 = load <3 x double>, <3 x double> addrspace(1)* undef, align 8, !tbaa !6
21 %tmp9 = extractelement <3 x double> %tmp8, i32 2
22 %tmp10 = insertelement <3 x double> undef, double %tmp9, i32 2
23 %tmp11 = fcmp olt <3 x double> %tmp10, %tmp7
24 %tmp12 = select <3 x i1> %tmp11, <3 x double> zeroinitializer, <3 x double> <double 1.000000e+00, double 1.000000e+00, double 1.000000e+00>
25 %tmp13 = extractelement <3 x double> %tmp12, i64 1
26 %tmp14 = insertelement <2 x double> undef, double %tmp13, i32 1
27 store <2 x double> %tmp14, <2 x double> addrspace(1)* undef, align 8, !tbaa !6
31 ; This caused failure in Selection DAG due to lack of insert_subvector implementation.
33 ; CHECK-LABEL: name: test2
34 ; CHECK: GLOBAL_LOAD_DWORDX2
35 ; CHECK: GLOBAL_LOAD_DWORDX2
36 ; CHECK: GLOBAL_STORE_DWORDX2
37 define protected amdgpu_kernel void @test2() local_unnamed_addr !kernel_arg_addr_space !0 !kernel_arg_access_qual !1 !kernel_arg_type !2 !kernel_arg_base_type !2 !kernel_arg_type_qual !3 !kernel_arg_name !4 {
39 %tmp = load <3 x i64>, <3 x i64> addrspace(4)* undef, align 16, !invariant.load !5
40 %srcA.load2 = extractelement <3 x i64> %tmp, i32 0
41 %tmp1 = inttoptr i64 %srcA.load2 to double addrspace(1)*
42 %tmp2 = getelementptr inbounds double, double addrspace(1)* %tmp1, i64 undef
43 %tmp3 = bitcast double addrspace(1)* %tmp2 to <3 x double> addrspace(1)*
44 %tmp4 = load <3 x double>, <3 x double> addrspace(1)* %tmp3, align 8, !tbaa !6
45 %tmp5 = extractelement <3 x double> %tmp4, i32 1
46 %tmp6 = insertelement <3 x double> undef, double %tmp5, i32 1
47 %tmp7 = insertelement <3 x double> %tmp6, double undef, i32 2
48 %tmp8 = load <3 x double>, <3 x double> addrspace(1)* undef, align 8, !tbaa !6
49 %tmp9 = extractelement <3 x double> %tmp8, i32 1
50 %tmp10 = insertelement <3 x double> undef, double %tmp9, i32 1
51 %tmp11 = insertelement <3 x double> %tmp10, double undef, i32 2
52 %tmp12 = fcmp olt <3 x double> %tmp11, %tmp7
53 %tmp13 = select <3 x i1> %tmp12, <3 x double> zeroinitializer, <3 x double> <double 1.000000e+00, double 1.000000e+00, double 1.000000e+00>
54 %tmp14 = extractelement <3 x double> %tmp13, i64 2
55 store double %tmp14, double addrspace(1)* undef, align 8, !tbaa !6
59 !0 = !{i32 1, i32 1, i32 1}
60 !1 = !{!"none", !"none", !"none"}
61 !2 = !{!"double*", !"double*", !"double*"}
63 !4 = !{!"srcA", !"srcB", !"dst"}
66 !7 = !{!"double", !8, i64 0}
67 !8 = !{!"omnipotent char", !9, i64 0}
68 !9 = !{!"Simple C/C++ TBAA"}