@@ -171,6 +171,43 @@ exit:
171171 ret void
172172}
173173
174+ define void @test_scalar_steps (ptr nocapture %a , ptr noalias %b , i64 %size ) !dbg !39 {
175+ ; CHECK-LABEL: define void @test_scalar_steps(
176+ ; CHECK: vector.body:
177+ ; CHECK-NEXT: [[INDEX:%.*]] = phi i64 [ 0, %vector.ph ], [ [[INDEX_NEXT:%.*]], %vector.body ]
178+ ; CHECK-NEXT: [[OFFSET_IDX:%.*]] = mul i64 [[INDEX]], 2
179+ ; CHECK-NEXT: [[TMP6:%.*]] = add i64 [[OFFSET_IDX]], 0
180+ ; CHECK-NOT: !dbg
181+ ; CHECK-NEXT: [[TMP7:%.*]] = add i64 [[OFFSET_IDX]], 2
182+ ; CHECK-NEXT: [[TMP8:%.*]] = getelementptr inbounds i32, ptr [[A:%.*]], i64 [[TMP6]]
183+ ; CHECK-NEXT: [[TMP9:%.*]] = getelementptr inbounds i32, ptr [[A]], i64 [[TMP7]]
184+ ; CHECK-NEXT: [[TMP10:%.*]] = getelementptr inbounds i32, ptr [[B:%.*]], i64 [[TMP6]]
185+ ; CHECK-NEXT: [[TMP11:%.*]] = getelementptr inbounds i32, ptr [[B]], i64 [[TMP7]]
186+ ; CHECK-NEXT: [[TMP12:%.*]] = load i32, ptr [[TMP8]], align 4
187+ ; CHECK-NEXT: [[TMP13:%.*]] = load i32, ptr [[TMP9]], align 4
188+ ; CHECK-NEXT: store i32 [[TMP12]], ptr [[TMP10]], align 4
189+ ; CHECK-NEXT: store i32 [[TMP13]], ptr [[TMP11]], align 4
190+ ; CHECK-NEXT: [[INDEX_NEXT]] = add nuw i64 [[INDEX]], 2
191+ ; CHECK-NEXT: [[TMP20:%.*]] = icmp eq i64 [[INDEX_NEXT]], %n.vec
192+ ; CHECK-NEXT: br i1 [[TMP20]], label %middle.block, label %vector.body
193+ ;
194+ entry:
195+ br label %loop
196+
197+ loop:
198+ %iv = phi i64 [ 0 , %entry ], [ %iv.next , %loop ], !dbg !41
199+ %arrayidx.1 = getelementptr inbounds i32 , ptr %a , i64 %iv
200+ %arrayidx.2 = getelementptr inbounds i32 , ptr %b , i64 %iv
201+ %l.1 = load i32 , ptr %arrayidx.1 , align 4
202+ store i32 %l.1 , ptr %arrayidx.2
203+ %iv.next = add i64 %iv , 2
204+ %exitcond = icmp ne i64 %iv.next , %size
205+ br i1 %exitcond , label %loop , label %exit
206+
207+ exit:
208+ ret void
209+ }
210+
174211; CHECK: ![[LOC2]] = !DILocation(line: 3
175212; CHECK: ![[BR_LOC]] = !DILocation(line: 5,
176213; CHECK: ![[LOC1]] = !DILocation(line: 6
@@ -223,3 +260,6 @@ declare void @llvm.dbg.value(metadata, metadata, metadata)
223260!36 = distinct !DILexicalBlock (scope: !35 , file: !5 , line: 137 , column: 2 )
224261!37 = !DILocation (line: 430 , column: 44 , scope: !36 )
225262!38 = !DILocation (line: 540 , column: 44 , scope: !36 )
263+ !39 = distinct !DISubprogram (name: "test_scalar_Steps" , line: 3 , isLocal: false , isDefinition: true , virtualIndex: 6 , flags: DIFlagPrototyped, isOptimized: true , unit: !0 , scopeLine: 3 , file: !5 , scope: !6 , type: !7 , retainedNodes: !12 )
264+ !40 = distinct !DILexicalBlock (scope: !39 , file: !5 , line: 137 , column: 2 )
265+ !41 = !DILocation (line: 650 , column: 44 , scope: !40 )
0 commit comments