1
- ; RUN: opt -S -loop-vectorize -force-vector-interleave=1 -instcombine -mattr=+sve -mtriple aarch64-unknown-linux-gnu -scalable-vectorization=on \
2
- ; RUN: -pass-remarks-missed=loop-vectorize < %s 2>%t | FileCheck %s
3
- ; RUN: cat %t | FileCheck %s --check-prefix=CHECK-REMARKS
1
+ ; RUN: opt -S -loop-vectorize -force-vector-interleave=1 -instcombine -mattr=+sve -mtriple aarch64-unknown-linux-gnu -scalable-vectorization=on < %s | FileCheck %s
4
2
5
3
define void @vec_load (i64 %N , double * nocapture %a , double * nocapture readonly %b ) {
6
4
; CHECK-LABEL: @vec_load
@@ -97,10 +95,6 @@ for.end:
97
95
ret void
98
96
}
99
97
100
- ; CHECK-REMARKS: UserVF ignored because of invalid costs.
101
- ; CHECK-REMARKS-NEXT: t.c:3:10: Instruction with invalid costs prevented vectorization at VF=(vscale x 1): load
102
- ; CHECK-REMARKS-NEXT: t.c:3:20: Instruction with invalid costs prevented vectorization at VF=(vscale x 1, vscale x 2): call to llvm.sin.f32
103
- ; CHECK-REMARKS-NEXT: t.c:3:30: Instruction with invalid costs prevented vectorization at VF=(vscale x 1): store
104
98
define void @vec_sin_no_mapping (float * noalias nocapture %dst , float * noalias nocapture readonly %src , i64 %n ) {
105
99
; CHECK: @vec_sin_no_mapping
106
100
; CHECK: call fast <2 x float> @llvm.sin.v2f32
@@ -111,46 +105,10 @@ entry:
111
105
for.body: ; preds = %entry, %for.body
112
106
%i.07 = phi i64 [ %inc , %for.body ], [ 0 , %entry ]
113
107
%arrayidx = getelementptr inbounds float , float * %src , i64 %i.07
114
- %0 = load float , float * %arrayidx , align 4 , !dbg !11
115
- %1 = tail call fast float @llvm.sin.f32 (float %0 ), !dbg !12
116
- %arrayidx1 = getelementptr inbounds float , float * %dst , i64 %i.07
117
- store float %1 , float * %arrayidx1 , align 4 , !dbg !13
118
- %inc = add nuw nsw i64 %i.07 , 1
119
- %exitcond.not = icmp eq i64 %inc , %n
120
- br i1 %exitcond.not , label %for.cond.cleanup , label %for.body , !llvm.loop !1
121
-
122
- for.cond.cleanup: ; preds = %for.body
123
- ret void
124
- }
125
-
126
- ; CHECK-REMARKS: UserVF ignored because of invalid costs.
127
- ; CHECK-REMARKS-NEXT: t.c:3:10: Instruction with invalid costs prevented vectorization at VF=(vscale x 1): load
128
- ; CHECK-REMARKS-NEXT: t.c:3:40: Instruction with invalid costs prevented vectorization at VF=(vscale x 1): store
129
- ; CHECK-REMARKS-NEXT: t.c:3:20: Instruction with invalid costs prevented vectorization at VF=(vscale x 1, vscale x 2): call to llvm.sin.f32
130
- ; CHECK-REMARKS-NEXT: t.c:3:30: Instruction with invalid costs prevented vectorization at VF=(vscale x 1, vscale x 2): call to llvm.sin.f32
131
- define void @vec_sin_no_mapping_ite (float * noalias nocapture %dst , float * noalias nocapture readonly %src , i64 %n ) {
132
- ; CHECK: @vec_sin_no_mapping_ite
133
- ; CHECK-NOT: <vscale x
134
- ; CHECK: ret
135
- entry:
136
- br label %for.body
137
-
138
- for.body: ; preds = %entry, %if.end
139
- %i.07 = phi i64 [ %inc , %if.end ], [ 0 , %entry ]
140
- %arrayidx = getelementptr inbounds float , float * %src , i64 %i.07
141
- %0 = load float , float * %arrayidx , align 4 , !dbg !11
142
- %cmp = fcmp ugt float %0 , 0 .0000
143
- br i1 %cmp , label %if.then , label %if.else
144
- if.then:
145
- %1 = tail call fast float @llvm.sin.f32 (float %0 ), !dbg !12
146
- br label %if.end
147
- if.else:
148
- %2 = tail call fast float @llvm.sin.f32 (float 0 .0 ), !dbg !13
149
- br label %if.end
150
- if.end:
151
- %3 = phi float [%1 , %if.then ], [%2 , %if.else ]
108
+ %0 = load float , float * %arrayidx , align 4
109
+ %1 = tail call fast float @llvm.sin.f32 (float %0 )
152
110
%arrayidx1 = getelementptr inbounds float , float * %dst , i64 %i.07
153
- store float %3 , float * %arrayidx1 , align 4 , !dbg !14
111
+ store float %1 , float * %arrayidx1 , align 4
154
112
%inc = add nuw nsw i64 %i.07 , 1
155
113
%exitcond.not = icmp eq i64 %inc , %n
156
114
br i1 %exitcond.not , label %for.cond.cleanup , label %for.body , !llvm.loop !1
@@ -159,10 +117,6 @@ for.cond.cleanup: ; preds = %for.body
159
117
ret void
160
118
}
161
119
162
- ; CHECK-REMARKS: UserVF ignored because of invalid costs.
163
- ; CHECK-REMARKS-NEXT: t.c:3:10: Instruction with invalid costs prevented vectorization at VF=(vscale x 1): load
164
- ; CHECK-REMARKS-NEXT: t.c:3:20: Instruction with invalid costs prevented vectorization at VF=(vscale x 1, vscale x 2): call to llvm.sin.f32
165
- ; CHECK-REMARKS-NEXT: t.c:3:30: Instruction with invalid costs prevented vectorization at VF=(vscale x 1): store
166
120
define void @vec_sin_fixed_mapping (float * noalias nocapture %dst , float * noalias nocapture readonly %src , i64 %n ) {
167
121
; CHECK: @vec_sin_fixed_mapping
168
122
; CHECK: call fast <2 x float> @llvm.sin.v2f32
@@ -173,10 +127,10 @@ entry:
173
127
for.body: ; preds = %entry, %for.body
174
128
%i.07 = phi i64 [ %inc , %for.body ], [ 0 , %entry ]
175
129
%arrayidx = getelementptr inbounds float , float * %src , i64 %i.07
176
- %0 = load float , float * %arrayidx , align 4 , !dbg !11
177
- %1 = tail call fast float @llvm.sin.f32 (float %0 ) #3 , !dbg !12
130
+ %0 = load float , float * %arrayidx , align 4
131
+ %1 = tail call fast float @llvm.sin.f32 (float %0 ) #3
178
132
%arrayidx1 = getelementptr inbounds float , float * %dst , i64 %i.07
179
- store float %1 , float * %arrayidx1 , align 4 , !dbg !13
133
+ store float %1 , float * %arrayidx1 , align 4
180
134
%inc = add nuw nsw i64 %i.07 , 1
181
135
%exitcond.not = icmp eq i64 %inc , %n
182
136
br i1 %exitcond.not , label %for.cond.cleanup , label %for.body , !llvm.loop !1
@@ -229,19 +183,3 @@ attributes #3 = { "vector-function-abi-variant"="_ZGV_LLVM_N2v_llvm.sin.f64(sin_
229
183
!1 = distinct !{!1 , !2 , !3 }
230
184
!2 = !{!"llvm.loop.vectorize.width" , i32 2 }
231
185
!3 = !{!"llvm.loop.vectorize.scalable.enable" , i1 true }
232
-
233
- !llvm.dbg.cu = !{!4 }
234
- !llvm.module.flags = !{!7 }
235
- !llvm.ident = !{!8 }
236
-
237
- !4 = distinct !DICompileUnit (language: DW_LANG_C99, file: !5 , producer: "clang" , isOptimized: true , runtimeVersion: 0 , emissionKind: NoDebug, enums: !6 , splitDebugInlining: false , nameTableKind: None)
238
- !5 = !DIFile (filename: "t.c" , directory: "somedir" )
239
- !6 = !{}
240
- !7 = !{i32 2 , !"Debug Info Version" , i32 3 }
241
- !8 = !{!"clang" }
242
- !9 = distinct !DISubprogram (name: "foo" , scope: !5 , file: !5 , line: 2 , type: !10 , scopeLine: 2 , flags: DIFlagPrototyped, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !4 , retainedNodes: !6 )
243
- !10 = !DISubroutineType (types: !6 )
244
- !11 = !DILocation (line: 3 , column: 10 , scope: !9 )
245
- !12 = !DILocation (line: 3 , column: 20 , scope: !9 )
246
- !13 = !DILocation (line: 3 , column: 30 , scope: !9 )
247
- !14 = !DILocation (line: 3 , column: 40 , scope: !9 )
0 commit comments