[clang][modules] Don't prevent translation of FW_Private includes when explicitly...
[llvm-project.git] / llvm / test / Transforms / LoopUnroll / wrong_assert_in_peeling.ll
blob32f8baeb8d69fb7842779f9b1c85c2ee27974dd0
1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt -S < %s -passes=loop-unroll | FileCheck %s
3 target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128-ni:1-p2:32:8:8:32-ni:2"
4 target triple = "x86_64-unknown-linux-gnu"
6 define i32 @test() {
7 ; CHECK-LABEL: @test(
8 ; CHECK-NEXT:  bb:
9 ; CHECK-NEXT:    br label [[BB1:%.*]]
10 ; CHECK:       bb1:
11 ; CHECK-NEXT:    [[TMP:%.*]] = phi i32 [ -147, [[BB:%.*]] ], [ [[TMP14:%.*]], [[BB13:%.*]] ]
12 ; CHECK-NEXT:    br label [[BB2_PEEL_BEGIN:%.*]]
13 ; CHECK:       bb2.peel.begin:
14 ; CHECK-NEXT:    br label [[BB2_PEEL:%.*]]
15 ; CHECK:       bb2.peel:
16 ; CHECK-NEXT:    [[TMP4_PEEL:%.*]] = add nsw i32 undef, [[TMP]]
17 ; CHECK-NEXT:    br label [[BB5_PEEL:%.*]]
18 ; CHECK:       bb5.peel:
19 ; CHECK-NEXT:    [[TMP6_PEEL:%.*]] = icmp eq i32 undef, 33
20 ; CHECK-NEXT:    br i1 [[TMP6_PEEL]], label [[BB7_PEEL:%.*]], label [[BB15_LOOPEXIT2:%.*]]
21 ; CHECK:       bb7.peel:
22 ; CHECK-NEXT:    [[TMP8_PEEL:%.*]] = sub nsw i32 undef, undef
23 ; CHECK-NEXT:    [[TMP9_PEEL:%.*]] = icmp eq i32 [[TMP8_PEEL]], 0
24 ; CHECK-NEXT:    br i1 [[TMP9_PEEL]], label [[BB10_PEEL:%.*]], label [[BB10_PEEL]]
25 ; CHECK:       bb10.peel:
26 ; CHECK-NEXT:    [[TMP11_PEEL:%.*]] = icmp eq i8 undef, 0
27 ; CHECK-NEXT:    br i1 [[TMP11_PEEL]], label [[BB12_PEEL:%.*]], label [[BB17_LOOPEXIT3:%.*]]
28 ; CHECK:       bb12.peel:
29 ; CHECK-NEXT:    br i1 false, label [[BB13]], label [[BB2_PEEL_NEXT:%.*]]
30 ; CHECK:       bb2.peel.next:
31 ; CHECK-NEXT:    br label [[BB2_PEEL_NEXT1:%.*]]
32 ; CHECK:       bb2.peel.next1:
33 ; CHECK-NEXT:    br label [[BB1_PEEL_NEWPH:%.*]]
34 ; CHECK:       bb1.peel.newph:
35 ; CHECK-NEXT:    br label [[BB2:%.*]]
36 ; CHECK:       bb2:
37 ; CHECK-NEXT:    [[TMP3:%.*]] = phi i32 [ [[TMP4_PEEL]], [[BB1_PEEL_NEWPH]] ], [ [[TMP4:%.*]], [[BB12:%.*]] ]
38 ; CHECK-NEXT:    [[TMP4]] = add nsw i32 [[TMP3]], [[TMP]]
39 ; CHECK-NEXT:    br label [[BB5:%.*]]
40 ; CHECK:       bb5:
41 ; CHECK-NEXT:    br i1 undef, label [[BB7:%.*]], label [[BB15_LOOPEXIT:%.*]]
42 ; CHECK:       bb7:
43 ; CHECK-NEXT:    br i1 undef, label [[BB10:%.*]], label [[BB10]]
44 ; CHECK:       bb10:
45 ; CHECK-NEXT:    br i1 undef, label [[BB12]], label [[BB17_LOOPEXIT:%.*]]
46 ; CHECK:       bb12:
47 ; CHECK-NEXT:    br i1 false, label [[BB13_LOOPEXIT:%.*]], label [[BB2]], !llvm.loop [[LOOP0:![0-9]+]]
48 ; CHECK:       bb13.loopexit:
49 ; CHECK-NEXT:    br label [[BB13]]
50 ; CHECK:       bb13:
51 ; CHECK-NEXT:    [[TMP14]] = add nsw i32 [[TMP]], -1
52 ; CHECK-NEXT:    br label [[BB1]]
53 ; CHECK:       bb15.loopexit:
54 ; CHECK-NEXT:    br label [[BB15:%.*]]
55 ; CHECK:       bb15.loopexit2:
56 ; CHECK-NEXT:    br label [[BB15]]
57 ; CHECK:       bb15:
58 ; CHECK-NEXT:    [[TMP16:%.*]] = call i32 (...) @llvm.experimental.deoptimize.i32(i32 17) [ "deopt"() ]
59 ; CHECK-NEXT:    ret i32 [[TMP16]]
60 ; CHECK:       bb17.loopexit:
61 ; CHECK-NEXT:    br label [[BB17:%.*]]
62 ; CHECK:       bb17.loopexit3:
63 ; CHECK-NEXT:    br label [[BB17]]
64 ; CHECK:       bb17:
65 ; CHECK-NEXT:    [[TMP18:%.*]] = call i32 (...) @llvm.experimental.deoptimize.i32(i32 6) [ "deopt"() ]
66 ; CHECK-NEXT:    ret i32 [[TMP18]]
68 bb:
69   br label %bb1
71 bb1:                                              ; preds = %bb13, %bb
72   %tmp = phi i32 [ -147, %bb ], [ %tmp14, %bb13 ]
73   br label %bb2
75 bb2:                                              ; preds = %bb12, %bb1
76   %tmp3 = phi i32 [ undef, %bb1 ], [ %tmp4, %bb12 ]
77   %tmp4 = add nsw i32 %tmp3, %tmp
78   br label %bb5
80 bb5:                                              ; preds = %bb2
81   %tmp6 = icmp eq i32 undef, 33
82   br i1 %tmp6, label %bb7, label %bb15
84 bb7:                                              ; preds = %bb5
85   %tmp8 = sub nsw i32 %tmp3, undef
86   %tmp9 = icmp eq i32 %tmp8, 0
87   br i1 %tmp9, label %bb10, label %bb10
89 bb10:                                             ; preds = %bb7, %bb7
90   %tmp11 = icmp eq i8 undef, 0
91   br i1 %tmp11, label %bb12, label %bb17
93 bb12:                                             ; preds = %bb10
94   br i1 false, label %bb13, label %bb2
96 bb13:                                             ; preds = %bb12
97   %tmp14 = add nsw i32 %tmp, -1
98   br label %bb1
100 bb15:                                             ; preds = %bb5
101   %tmp16 = call i32 (...) @llvm.experimental.deoptimize.i32(i32 17) [ "deopt"() ]
102   ret i32 %tmp16
104 bb17:                                             ; preds = %bb10
105   %tmp18 = call i32 (...) @llvm.experimental.deoptimize.i32(i32 6) [ "deopt"() ]
106   ret i32 %tmp18
109 declare i32 @llvm.experimental.deoptimize.i32(...)