1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
2 ; RUN: opt -passes=gvn -dom-tree-reachability-max-bbs-to-explore=1 -S < %s | FileCheck %s
3 define i8 @f(i1 %arg0, i1 %arg1, i1 %arg2) {
4 ; CHECK-LABEL: define i8 @f(
5 ; CHECK-SAME: i1 [[ARG0:%.*]], i1 [[ARG1:%.*]], i1 [[ARG2:%.*]]) {
6 ; CHECK-NEXT: [[BB:.*:]]
7 ; CHECK-NEXT: br i1 [[ARG2]], label %[[BB2:.*]], label %[[BB11:.*]]
9 ; CHECK-NEXT: br label %[[BB3:.*]]
11 ; CHECK-NEXT: br label %[[BB3]]
13 ; CHECK-NEXT: [[CALL:%.*]] = tail call noalias ptr @_Znwm(i64 2)
14 ; CHECK-NEXT: br label %[[BB4:.*]]
16 ; CHECK-NEXT: [[PHI:%.*]] = phi ptr [ null, %[[BB4]] ], [ [[CALL]], %[[BB3]] ]
17 ; CHECK-NEXT: store i8 2, ptr [[PHI]], align 4
18 ; CHECK-NEXT: br i1 [[ARG0]], label %[[BB5:.*]], label %[[BB4]]
20 ; CHECK-NEXT: br i1 [[ARG1]], label %[[BB7:.*]], label %[[BB6:.*]]
22 ; CHECK-NEXT: call void @use(i64 undef)
23 ; CHECK-NEXT: br label %[[BB9:.*]]
25 ; CHECK-NEXT: [[LOAD8:%.*]] = load i8, ptr [[CALL]], align 4
26 ; CHECK-NEXT: br label %[[BB9]]
28 ; CHECK-NEXT: [[PHI10:%.*]] = phi i8 [ [[LOAD8]], %[[BB7]] ], [ 4, %[[BB6]] ]
29 ; CHECK-NEXT: ret i8 [[PHI10]]
32 br i1 %arg2, label %bb2, label %bb11
41 %call = tail call noalias ptr @_Znwm(i64 2)
45 %phi = phi ptr [ null, %bb4 ], [ %call, %bb3 ]
46 store i8 2, ptr %phi, align 4
47 br i1 %arg0, label %bb5, label %bb4
50 br i1 %arg1, label %bb7, label %bb6
53 %load = load i64, ptr %call, align 4
54 call void @use(i64 %load)
58 %load8 = load i8, ptr %call, align 4
62 %phi10 = phi i8 [ %load8, %bb7 ], [ 4, %bb6 ]
66 declare ptr @_Znwm(i64)
67 declare void @use(i64)