1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 4
2 ; RUN: opt -S -passes=newgvn %s | FileCheck %s
4 @d = external global i32
5 @e = external global i32
6 define void @tinkywinky() {
7 ; CHECK-LABEL: define void @tinkywinky() {
8 ; CHECK-NEXT: br i1 true, label [[LOR_LHS_FALSE:%.*]], label [[COND_TRUE:%.*]]
9 ; CHECK: lor.lhs.false:
10 ; CHECK-NEXT: [[TMP:%.*]] = load i32, ptr @d, align 4
11 ; CHECK-NEXT: [[PATATINO:%.*]] = load i32, ptr null, align 4
12 ; CHECK-NEXT: [[OR:%.*]] = or i32 [[TMP]], [[PATATINO]]
13 ; CHECK-NEXT: store i32 [[OR]], ptr @d, align 4
14 ; CHECK-NEXT: br label [[COND_TRUE]]
16 ; CHECK-NEXT: [[TMP1:%.*]] = load i32, ptr @e, align 4
17 ; CHECK-NEXT: [[TMP2:%.*]] = load i32, ptr @d, align 4
18 ; CHECK-NEXT: [[CMP:%.*]] = icmp eq i32 [[TMP1]], [[TMP2]]
19 ; CHECK-NEXT: br i1 [[CMP]], label [[COND_TRUE6:%.*]], label [[COND_FALSE:%.*]]
21 ; CHECK-NEXT: [[CMP7:%.*]] = icmp slt i32 [[TMP1]], 0
22 ; CHECK-NEXT: br i1 [[CMP7]], label [[COND_FALSE]], label [[COND_FALSE]]
24 ; CHECK-NEXT: ret void
26 br i1 true, label %lor.lhs.false, label %cond.true
28 %tmp = load i32, ptr @d, align 4
29 %patatino = load i32, ptr null, align 4
30 %or = or i32 %tmp, %patatino
31 store i32 %or, ptr @d, align 4
34 %tmp1 = load i32, ptr @e, align 4
35 %tmp2 = load i32, ptr @d, align 4
36 %cmp = icmp eq i32 %tmp1, %tmp2
37 br i1 %cmp, label %cond.true6, label %cond.false
39 %cmp7 = icmp slt i32 %tmp1, 0
40 br i1 %cmp7, label %cond.false, label %cond.false