; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 4
; RUN: opt -S -passes=newgvn %s | FileCheck %s
@d = external global i32
@e = external global i32
define void @tinkywinky() {
; CHECK-LABEL: define void @tinkywinky() {
; CHECK-NEXT: br i1 true, label [[LOR_LHS_FALSE:%.*]], label [[COND_TRUE:%.*]]
; CHECK: lor.lhs.false:
; CHECK-NEXT: [[TMP:%.*]] = load i32, ptr @d, align 4
; CHECK-NEXT: [[PATATINO:%.*]] = load i32, ptr null, align 4
; CHECK-NEXT: [[OR:%.*]] = or i32 [[TMP]], [[PATATINO]]
; CHECK-NEXT: store i32 [[OR]], ptr @d, align 4
; CHECK-NEXT: br label [[COND_TRUE]]
; CHECK: cond.true:
; CHECK-NEXT: [[TMP1:%.*]] = load i32, ptr @e, align 4
; CHECK-NEXT: [[TMP2:%.*]] = load i32, ptr @d, align 4
; CHECK-NEXT: [[CMP:%.*]] = icmp eq i32 [[TMP1]], [[TMP2]]
; CHECK-NEXT: br i1 [[CMP]], label [[COND_TRUE6:%.*]], label [[COND_FALSE:%.*]]
; CHECK: cond.true6:
; CHECK-NEXT: [[CMP7:%.*]] = icmp slt i32 [[TMP1]], 0
; CHECK-NEXT: br i1 [[CMP7]], label [[COND_FALSE]], label [[COND_FALSE]]
; CHECK: cond.false:
; CHECK-NEXT: ret void
;
br i1 true, label %lor.lhs.false, label %cond.true
lor.lhs.false:
%tmp = load i32, ptr @d, align 4
%patatino = load i32, ptr null, align 4
%or = or i32 %tmp, %patatino
store i32 %or, ptr @d, align 4
br label %cond.true
cond.true:
%tmp1 = load i32, ptr @e, align 4
%tmp2 = load i32, ptr @d, align 4
%cmp = icmp eq i32 %tmp1, %tmp2
br i1 %cmp, label %cond.true6, label %cond.false
cond.true6:
%cmp7 = icmp slt i32 %tmp1, 0
br i1 %cmp7, label %cond.false, label %cond.false
cond.false:
ret void
}