Home | History | Annotate | Download | only in SimplifyCFG
      1 ; RUN: opt < %s -simplifycfg -S | \
      2 ; RUN:   not grep select
      3 
      4 ;; The PHI node in this example should not be turned into a select, as we are
      5 ;; not able to ifcvt the entire block.  As such, converting to a select just 
      6 ;; introduces inefficiency without saving copies.
      7 
      8 define i32 @bar(i1 %C) {
      9 entry:
     10         br i1 %C, label %then, label %endif
     11 then:           ; preds = %entry
     12         %tmp.3 = call i32 @qux( )               ; <i32> [#uses=0]
     13         br label %endif
     14 endif:          ; preds = %then, %entry
     15         %R = phi i32 [ 123, %entry ], [ 12312, %then ]          ; <i32> [#uses=1]
     16         ;; stuff to disable tail duplication
     17         call i32 @qux( )                ; <i32>:0 [#uses=0]
     18         call i32 @qux( )                ; <i32>:1 [#uses=0]
     19         call i32 @qux( )                ; <i32>:2 [#uses=0]
     20         call i32 @qux( )                ; <i32>:3 [#uses=0]
     21         call i32 @qux( )                ; <i32>:4 [#uses=0]
     22         call i32 @qux( )                ; <i32>:5 [#uses=0]
     23         call i32 @qux( )                ; <i32>:6 [#uses=0]
     24         ret i32 %R
     25 }
     26 
     27 declare i32 @qux()
     28