Home | History | Annotate | Download | only in SimplifyCFG
      1 ; RUN: opt < %s -instcombine -simplifycfg -S | grep " = phi " | count 1
      2 
      3 ; instcombine should sort the PHI operands so that simplifycfg can see the
      4 ; duplicate and remove it.
      5 
      6 define i32 @foo(i1 %t) {
      7 entry:
      8   call void @bar()
      9   br i1 %t, label %true, label %false
     10 true:
     11   call void @bar()
     12   br label %false
     13 false:
     14   %a = phi i32 [ 2, %true ], [ 5, %entry ]
     15   %b = phi i32 [ 5, %entry ], [ 2, %true ]
     16   call void @bar()
     17   %c = add i32 %a, %b
     18   ret i32 %c
     19 }
     20 
     21 declare void @bar()
     22