1
- ; RUN: opt < %s -passes=loop-vectorize -S 2>&1 | FileCheck %s
2
- ; RUN: opt < %s -passes=debugify,loop-vectorize -S | FileCheck %s -check-prefix DEBUGLOC
3
- ; RUN: opt < %s -passes=debugify,loop-vectorize -S --try-experimental-debuginfo-iterators | FileCheck %s -check-prefix DEBUGLOC
1
+ ; RUN: opt < %s -passes=loop-vectorize -force-vector-width=4 - S 2>&1 | FileCheck %s
2
+ ; RUN: opt < %s -passes=debugify,loop-vectorize -force-vector-width=4 - S | FileCheck %s -check-prefix DEBUGLOC
3
+ ; RUN: opt < %s -passes=debugify,loop-vectorize -force-vector-width=4 - S --try-experimental-debuginfo-iterators | FileCheck %s -check-prefix DEBUGLOC
4
4
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
5
5
6
6
; This test makes sure we don't duplicate the loop vectorizer's metadata
7
7
; while marking them as already vectorized (by setting width = 1), even
8
8
; at lower optimization levels, where no extra cleanup is done
9
9
10
- ; DEBUGLOC-LABEL: define void @_Z3fooPf(
11
10
; Check that the phi to resume the scalar part of the loop
12
11
; has Debug Location.
13
12
define void @_Z3fooPf (ptr %a ) {
13
+ ; DEBUGLOC-LABEL: define void @_Z3fooPf(
14
+ ; DEBUGLOC: scalar.ph:
15
+ ; DEBUGLOC-NEXT: %bc.resume.val = phi {{.*}} !dbg ![[RESUMELOC:[0-9]+]]
16
+ ;
14
17
entry:
15
18
br label %for.body
16
19
@@ -24,16 +27,35 @@ for.body: ; preds = %for.body, %entry
24
27
%exitcond = icmp eq i64 %indvars.iv.next , 1024
25
28
br i1 %exitcond , label %for.end , label %for.body , !llvm.loop !0
26
29
27
- ; DEBUGLOC: scalar.ph:
28
- ; DEBUGLOC-NEXT: %bc.resume.val = phi {{.*}} !dbg ![[DbgLoc:[0-9]+]]
30
+ for.end: ; preds = %for.body
31
+ ret void
32
+ }
33
+
34
+ ; FIXME: Missing debug location for pointer induction in vector loop
35
+ define void @widen_ptr_induction_dbg (ptr %start , ptr %end ) {
36
+ ; DEBUGLOC-LABEL: define void @widen_ptr_induction_dbg(
37
+ ; DEBUGLOC: vector.body:
38
+ ; DEBUGLOC-NOT: = phi ptr {{.+}}, !dbg
39
+ ; DEBUGLOC: = phi i64
29
40
;
30
- ; DEBUGLOC: ![[DbgLoc]] = !DILocation(line: 2
41
+ entry:
42
+ br label %loop
31
43
32
- for.end: ; preds = %for.body
44
+ loop:
45
+ %iv = phi ptr [ %start , %entry ], [ %iv.next , %loop ]
46
+ %iv.next = getelementptr inbounds ptr , ptr %iv , i64 1
47
+ store ptr %iv , ptr %iv , align 1
48
+ %cmp.not = icmp eq ptr %iv.next , %end
49
+ br i1 %cmp.not , label %exit , label %loop
50
+
51
+ exit:
33
52
ret void
34
53
}
35
54
55
+
36
56
!0 = !{!0 , !1 }
37
57
!1 = !{!"llvm.loop.vectorize.width" , i32 4 }
38
58
; CHECK-NOT: !{metadata !"llvm.loop.vectorize.width", i32 4}
39
59
; CHECK: !{!"llvm.loop.isvectorized", i32 1}
60
+
61
+ ; DEBUGLOC: ![[RESUMELOC]] = !DILocation(line: 2
0 commit comments