1; RUN: opt < %s -S -instcombine | FileCheck %s 2@A = extern_weak global i32, align 4 3@B = extern_weak global i32, align 4 4 5define i32 @foo(i1 %which) { 6entry: 7 br i1 %which, label %final, label %delay 8 9delay: 10 br label %final 11 12; CHECK-LABEL: final: 13; CHECK: phi i32 [ 1, %entry ], [ select (i1 icmp eq (i32* @A, i32* @B), i32 2, i32 1), %delay ] 14final: 15 %use2 = phi i1 [ false, %entry ], [ icmp eq (i32* @A, i32* @B), %delay ] 16 %value = select i1 %use2, i32 2, i32 1 17 ret i32 %value 18} 19 20