1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt -passes="loop(indvars,loop-deletion,loop-unroll-full)" -verify-scev -S %s | FileCheck %s
4 define i32 @test(i32 %p_16, i1 %c) {
7 ; CHECK-NEXT: [[XOR:%.*]] = xor i32 [[P_16:%.*]], 6
8 ; CHECK-NEXT: [[OR_1:%.*]] = or disjoint i32 [[XOR]], [[P_16]]
9 ; CHECK-NEXT: [[XOR_1:%.*]] = xor i32 [[OR_1]], 6
10 ; CHECK-NEXT: [[OR_2:%.*]] = or disjoint i32 [[XOR_1]], [[P_16]]
11 ; CHECK-NEXT: [[XOR_2:%.*]] = xor i32 [[OR_2]], 6
12 ; CHECK-NEXT: br label [[OUTER_HEADER:%.*]]
13 ; CHECK: outer.header:
14 ; CHECK-NEXT: br label [[INNER_HEADER:%.*]]
15 ; CHECK: inner.header:
16 ; CHECK-NEXT: br i1 [[C:%.*]], label [[OUTER_LATCH:%.*]], label [[INNER_LATCH:%.*]]
18 ; CHECK-NEXT: br i1 [[C]], label [[OUTER_LATCH]], label [[INNER_LATCH_1:%.*]]
19 ; CHECK: inner.latch.1:
20 ; CHECK-NEXT: br i1 [[C]], label [[OUTER_LATCH]], label [[INNER_LATCH_2:%.*]]
21 ; CHECK: inner.latch.2:
22 ; CHECK-NEXT: br i1 [[C]], label [[OUTER_LATCH]], label [[INNER_LATCH_3:%.*]]
23 ; CHECK: inner.latch.3:
24 ; CHECK-NEXT: [[XOR_2_LCSSA:%.*]] = phi i32 [ [[XOR_2]], [[INNER_LATCH_2]] ]
25 ; CHECK-NEXT: [[OR_3:%.*]] = or disjoint i32 [[XOR_2_LCSSA]], [[P_16]]
26 ; CHECK-NEXT: [[XOR_3:%.*]] = xor i32 [[OR_3]], 6
27 ; CHECK-NEXT: ret i32 [[XOR_3]]
29 ; CHECK-NEXT: br label [[OUTER_HEADER]]
32 br label %outer.header
35 %p.1 = phi i32 [ 0, %entry ], [ %p.2.lcssa, %outer.latch ]
36 br label %inner.header
39 %p.2 = phi i32 [ %p.1, %outer.header ], [ %xor, %inner.latch]
40 %p.3 = phi i32 [ 0, %outer.header ], [ %add, %inner.latch ]
41 br i1 %c, label %outer.latch, label %inner.latch
44 %or = or disjoint i32 %p.2, %p_16
46 %add = add nuw nsw i32 %p.3, 1
47 %cmp = icmp ult i32 %p.3, 3
48 br i1 %cmp, label %inner.header, label %exit
50 outer.latch: ; preds = %for.body2928
51 %p.2.lcssa = phi i32 [ %p.2, %inner.header ]
52 br label %outer.header
55 %xor.lcssa = phi i32 [ %xor, %inner.latch ]