llvm.org GIT mirror llvm / 45e4e1c
[SLP] add tests for PR16739; NFC git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369127 91177308-0d34-0410-b5e6-96231b3b80d8 Sanjay Patel a month ago
1 changed file(s) with 68 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
4747 %or11 = or i32 %or7, %shl10
4848 ret i32 %or11
4949 }
50
51 define <4 x float> @PR16739_byref(<4 x float>* nocapture readonly dereferenceable(16) %x) {
52 ; CHECK-LABEL: @PR16739_byref(
53 ; CHECK-NEXT: [[GEP0:%.*]] = getelementptr inbounds <4 x float>, <4 x float>* [[X:%.*]], i64 0, i64 0
54 ; CHECK-NEXT: [[GEP1:%.*]] = getelementptr inbounds <4 x float>, <4 x float>* [[X]], i64 0, i64 1
55 ; CHECK-NEXT: [[GEP2:%.*]] = getelementptr inbounds <4 x float>, <4 x float>* [[X]], i64 0, i64 2
56 ; CHECK-NEXT: [[TMP1:%.*]] = bitcast float* [[GEP0]] to <2 x float>*
57 ; CHECK-NEXT: [[TMP2:%.*]] = load <2 x float>, <2 x float>* [[TMP1]], align 4
58 ; CHECK-NEXT: [[X2:%.*]] = load float, float* [[GEP2]]
59 ; CHECK-NEXT: [[TMP3:%.*]] = extractelement <2 x float> [[TMP2]], i32 0
60 ; CHECK-NEXT: [[I0:%.*]] = insertelement <4 x float> undef, float [[TMP3]], i32 0
61 ; CHECK-NEXT: [[TMP4:%.*]] = extractelement <2 x float> [[TMP2]], i32 1
62 ; CHECK-NEXT: [[I1:%.*]] = insertelement <4 x float> [[I0]], float [[TMP4]], i32 1
63 ; CHECK-NEXT: [[I2:%.*]] = insertelement <4 x float> [[I1]], float [[X2]], i32 2
64 ; CHECK-NEXT: [[I3:%.*]] = insertelement <4 x float> [[I2]], float [[X2]], i32 3
65 ; CHECK-NEXT: ret <4 x float> [[I3]]
66 ;
67 %gep0 = getelementptr inbounds <4 x float>, <4 x float>* %x, i64 0, i64 0
68 %gep1 = getelementptr inbounds <4 x float>, <4 x float>* %x, i64 0, i64 1
69 %gep2 = getelementptr inbounds <4 x float>, <4 x float>* %x, i64 0, i64 2
70 %x0 = load float, float* %gep0
71 %x1 = load float, float* %gep1
72 %x2 = load float, float* %gep2
73 %i0 = insertelement <4 x float> undef, float %x0, i32 0
74 %i1 = insertelement <4 x float> %i0, float %x1, i32 1
75 %i2 = insertelement <4 x float> %i1, float %x2, i32 2
76 %i3 = insertelement <4 x float> %i2, float %x2, i32 3
77 ret <4 x float> %i3
78 }
79
80 define <4 x float> @PR16739_byval(<4 x float>* nocapture readonly dereferenceable(16) %x) {
81 ; CHECK-LABEL: @PR16739_byval(
82 ; CHECK-NEXT: [[T0:%.*]] = bitcast <4 x float>* [[X:%.*]] to i64*
83 ; CHECK-NEXT: [[T1:%.*]] = load i64, i64* [[T0]], align 16
84 ; CHECK-NEXT: [[T2:%.*]] = getelementptr inbounds <4 x float>, <4 x float>* [[X]], i64 0, i64 2
85 ; CHECK-NEXT: [[T3:%.*]] = bitcast float* [[T2]] to i64*
86 ; CHECK-NEXT: [[T4:%.*]] = load i64, i64* [[T3]], align 8
87 ; CHECK-NEXT: [[T5:%.*]] = trunc i64 [[T1]] to i32
88 ; CHECK-NEXT: [[T6:%.*]] = bitcast i32 [[T5]] to float
89 ; CHECK-NEXT: [[T7:%.*]] = insertelement <4 x float> undef, float [[T6]], i32 0
90 ; CHECK-NEXT: [[T8:%.*]] = lshr i64 [[T1]], 32
91 ; CHECK-NEXT: [[T9:%.*]] = trunc i64 [[T8]] to i32
92 ; CHECK-NEXT: [[T10:%.*]] = bitcast i32 [[T9]] to float
93 ; CHECK-NEXT: [[T11:%.*]] = insertelement <4 x float> [[T7]], float [[T10]], i32 1
94 ; CHECK-NEXT: [[T12:%.*]] = trunc i64 [[T4]] to i32
95 ; CHECK-NEXT: [[T13:%.*]] = bitcast i32 [[T12]] to float
96 ; CHECK-NEXT: [[T14:%.*]] = insertelement <4 x float> [[T11]], float [[T13]], i32 2
97 ; CHECK-NEXT: [[T15:%.*]] = insertelement <4 x float> [[T14]], float [[T13]], i32 3
98 ; CHECK-NEXT: ret <4 x float> [[T15]]
99 ;
100 %t0 = bitcast <4 x float>* %x to i64*
101 %t1 = load i64, i64* %t0, align 16
102 %t2 = getelementptr inbounds <4 x float>, <4 x float>* %x, i64 0, i64 2
103 %t3 = bitcast float* %t2 to i64*
104 %t4 = load i64, i64* %t3, align 8
105 %t5 = trunc i64 %t1 to i32
106 %t6 = bitcast i32 %t5 to float
107 %t7 = insertelement <4 x float> undef, float %t6, i32 0
108 %t8 = lshr i64 %t1, 32
109 %t9 = trunc i64 %t8 to i32
110 %t10 = bitcast i32 %t9 to float
111 %t11 = insertelement <4 x float> %t7, float %t10, i32 1
112 %t12 = trunc i64 %t4 to i32
113 %t13 = bitcast i32 %t12 to float
114 %t14 = insertelement <4 x float> %t11, float %t13, i32 2
115 %t15 = insertelement <4 x float> %t14, float %t13, i32 3
116 ret <4 x float> %t15
117 }