1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt -passes=instcombine -S %s | FileCheck %s
4 @A = extern_weak global i32, align 4
5 @B = extern_weak global i32, align 4
7 define i32 @foo(i1 %which, ptr %dst) {
10 ; CHECK-NEXT: br i1 true, label [[FINAL:%.*]], label [[DELAY:%.*]]
12 ; CHECK-NEXT: br label [[FINAL]]
14 ; CHECK-NEXT: store i1 false, ptr [[DST:%.*]], align 1
15 ; CHECK-NEXT: ret i32 1
18 br i1 true, label %final, label %delay
20 delay: ; preds = %entry
21 %cmp = icmp eq ptr @A, @B
24 final: ; preds = %delay, %entry
25 %use2 = phi i1 [ false, %entry ], [ %cmp, %delay ]
26 %value = select i1 %use2, i32 2, i32 1
27 %B7 = mul i32 %value, 2147483647
28 %C3 = icmp ule i32 %B7, 0
29 store i1 %C3, ptr %dst