1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 3
2 ; RUN: opt -S -passes=gvn < %s | FileCheck %s
4 ; Make sure deduplicated phi nodes are removed from the VN map.
6 ; CHECK-LABEL: define i64 @f() {
8 ; CHECK-NEXT: store i1 false, ptr null, align 1
9 ; CHECK-NEXT: br label [[BB2D:%.*]]
11 ; CHECK-NEXT: br label [[BB2B:%.*]]
13 ; CHECK-NEXT: [[L93_PRE_PRE:%.*]] = load i1, ptr inttoptr (i64 -1 to ptr), align 1
14 ; CHECK-NEXT: br label [[BB2C:%.*]]
16 ; CHECK-NEXT: [[L93_PRE:%.*]] = phi i1 [ [[L93_PRE_PRE]], [[BB2B]] ], [ true, [[BB2D]] ]
17 ; CHECK-NEXT: [[AZ2:%.*]] = phi i1 [ true, [[BB2B]] ], [ [[AZ:%.*]], [[BB2D]] ]
18 ; CHECK-NEXT: [[DOTPHI_TRANS_INSERT:%.*]] = sext i1 [[AZ2]] to i64
19 ; CHECK-NEXT: [[GEP2_PHI_TRANS_INSERT:%.*]] = getelementptr i1, ptr null, i64 [[DOTPHI_TRANS_INSERT]]
20 ; CHECK-NEXT: br label [[BB2D]]
22 ; CHECK-NEXT: [[L93_PRE5:%.*]] = phi i1 [ [[L93_PRE]], [[BB2C]] ], [ false, [[BB:%.*]] ]
23 ; CHECK-NEXT: [[AZ]] = phi i1 [ [[AZ2]], [[BB2C]] ], [ false, [[BB]] ]
24 ; CHECK-NEXT: [[TMP0:%.*]] = sext i1 [[AZ]] to i64
25 ; CHECK-NEXT: [[GEP2:%.*]] = getelementptr i1, ptr null, i64 [[TMP0]]
26 ; CHECK-NEXT: store i1 [[AZ]], ptr null, align 2
27 ; CHECK-NEXT: br i1 [[L93_PRE5]], label [[BB2C]], label [[BB1E:%.*]]
29 ; CHECK-NEXT: br i1 [[AZ]], label [[BB2F:%.*]], label [[BB4:%.*]]
31 ; CHECK-NEXT: store i1 true, ptr null, align 2
32 ; CHECK-NEXT: br label [[BB2B]]
34 ; CHECK-NEXT: br label [[BB4]]
37 store i1 false, ptr null, align 1
40 BB2a: ; No predecessors!
43 BB2b: ; preds = %BB2f, %BB2a
46 BB2c: ; preds = %BB2d, %BB2b
47 %0 = phi i1 [ true, %BB2b ], [ %1, %BB2d ]
50 BB2d: ; preds = %BB2c, %BB
51 %1 = phi i1 [ %0, %BB2c ], [ false, %BB ]
52 %2 = sext i1 %1 to i64
53 %gep2 = getelementptr i1, ptr null, i64 %2
54 %L93 = load i1, ptr %gep2, align 1
55 %Az = load i1, ptr null, align 2
56 store i1 %1, ptr null, align 2
57 br i1 %L93, label %BB2c, label %BB1e
60 br i1 %Az, label %BB2f, label %BB4
63 store i1 true, ptr null, align 2
66 BB4: ; preds = %BB1e, %BB4
69 ; uselistorder directives
70 uselistorder label %BB4, { 1, 0 }