1 ; This test is based on one of benchmarks from SPEC2006. It exposes a bug with
2 ; incorrect updating of the dom-tree.
3 ; RUN: opt < %s -passes=loop-vectorize -verify-dom-info
4 target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
6 @PL_utf8skip = external constant [0 x i8]
8 ; Function Attrs: nounwind ssp uwtable
9 define void @Perl_pp_quotemeta(i1 %arg) #0 {
10 %len = alloca i64, align 8
11 br i1 %arg, label %2, label %1
13 ; <label>:1 ; preds = %0
16 ; <label>:2 ; preds = %0
19 ; <label>:3 ; preds = %2, %1
20 br i1 %arg, label %34, label %4
22 ; <label>:4 ; preds = %3
23 br i1 %arg, label %5, label %6
25 ; <label>:5 ; preds = %4
28 ; <label>:6 ; preds = %5, %4
29 br i1 %arg, label %7, label %8
31 ; <label>:7 ; preds = %6
34 ; <label>:8 ; preds = %7, %6
35 br i1 %arg, label %.preheader, label %9
37 .preheader: ; preds = %9, %8
38 br i1 %arg, label %.loopexit, label %.lr.ph
40 ; <label>:9 ; preds = %8
41 br i1 %arg, label %thread-pre-split.preheader, label %.preheader
43 thread-pre-split.preheader: ; preds = %9
44 br i1 %arg, label %thread-pre-split._crit_edge, label %.lr.ph21
46 .thread-pre-split.loopexit_crit_edge: ; preds = %19
47 %scevgep.sum = xor i64 %umax, -1
48 %scevgep45 = getelementptr i8, ptr %d.020, i64 %scevgep.sum
49 br label %thread-pre-split.loopexit
51 thread-pre-split.loopexit: ; preds = %11, %.thread-pre-split.loopexit_crit_edge
52 %d.1.lcssa = phi ptr [ %scevgep45, %.thread-pre-split.loopexit_crit_edge ], [ %d.020, %11 ]
53 br i1 false, label %thread-pre-split._crit_edge, label %.lr.ph21
55 .lr.ph21: ; preds = %26, %thread-pre-split.loopexit, %thread-pre-split.preheader
56 %d.020 = phi ptr [ undef, %26 ], [ %d.1.lcssa, %thread-pre-split.loopexit ], [ undef, %thread-pre-split.preheader ]
57 %10 = phi i64 [ %28, %26 ], [ undef, %thread-pre-split.loopexit ], [ undef, %thread-pre-split.preheader ]
58 br i1 %arg, label %11, label %22
60 ; <label>:11 ; preds = %.lr.ph21
61 %12 = getelementptr inbounds [0 x i8], ptr @PL_utf8skip, i64 0, i64 undef
62 %13 = load i8, ptr %12, align 1
63 %14 = zext i8 %13 to i64
64 %15 = icmp ugt i64 %14, %10
65 %. = select i1 %15, i64 %10, i64 %14
66 br i1 %arg, label %thread-pre-split.loopexit, label %.lr.ph28
68 .lr.ph28: ; preds = %11
71 %18 = icmp ugt i64 %16, %17
72 %umax = select i1 %18, i64 %16, i64 %17
75 ; <label>:19 ; preds = %19, %.lr.ph28
76 %ulen.126 = phi i64 [ %., %.lr.ph28 ], [ %20, %19 ]
77 %20 = add i64 %ulen.126, -1
78 %21 = icmp eq i64 %20, 0
79 br i1 %21, label %.thread-pre-split.loopexit_crit_edge, label %19
81 ; <label>:22 ; preds = %.lr.ph21
82 br i1 %arg, label %26, label %23
84 ; <label>:23 ; preds = %22
85 br i1 %arg, label %26, label %24
87 ; <label>:24 ; preds = %23
88 br i1 %arg, label %26, label %25
90 ; <label>:25 ; preds = %24
93 ; <label>:26 ; preds = %25, %24, %23, %22
94 %27 = load i64, ptr %len, align 8
96 br i1 %arg, label %thread-pre-split._crit_edge, label %.lr.ph21
98 thread-pre-split._crit_edge: ; preds = %26, %thread-pre-split.loopexit, %thread-pre-split.preheader
101 .lr.ph: ; preds = %33, %.preheader
102 br i1 %arg, label %29, label %thread-pre-split5
104 ; <label>:29 ; preds = %.lr.ph
105 br i1 %arg, label %33, label %30
107 ; <label>:30 ; preds = %29
108 br i1 %arg, label %33, label %31
110 thread-pre-split5: ; preds = %.lr.ph
111 br i1 %arg, label %33, label %31
113 ; <label>:31 ; preds = %thread-pre-split5, %30
114 br i1 %arg, label %33, label %32
116 ; <label>:32 ; preds = %31
119 ; <label>:33 ; preds = %32, %31, %thread-pre-split5, %30, %29
120 br i1 %arg, label %.loopexit, label %.lr.ph
122 .loopexit: ; preds = %33, %thread-pre-split._crit_edge, %.preheader
125 ; <label>:34 ; preds = %3
128 ; <label>:35 ; preds = %34, %.loopexit
129 br i1 %arg, label %37, label %36
131 ; <label>:36 ; preds = %35
134 ; <label>:37 ; preds = %36, %35
138 attributes #0 = { nounwind ssp uwtable "less-precise-fpmad"="false" "frame-pointer"="all" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" }
142 !0 = !{!"clang version 3.6.0 "}