Dan Gohman | 3c7d308 | 2009-09-11 18:01:28 +0000 | [diff] [blame] | 1 | ; RUN: opt < %s -simplifycfg -S | \ |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 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 | |
Tanya Lattner | b46665e | 2008-03-18 03:45:45 +0000 | [diff] [blame] | 8 | define i32 @bar(i1 %C) { |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 9 | entry: |
Tanya Lattner | b46665e | 2008-03-18 03:45:45 +0000 | [diff] [blame] | 10 | br i1 %C, label %then, label %endif |
| 11 | then: ; preds = %entry |
| 12 | %tmp.3 = call i32 @qux( ) ; <i32> [#uses=0] |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 13 | br label %endif |
Tanya Lattner | b46665e | 2008-03-18 03:45:45 +0000 | [diff] [blame] | 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 |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 25 | } |
| 26 | |
Tanya Lattner | b46665e | 2008-03-18 03:45:45 +0000 | [diff] [blame] | 27 | declare i32 @qux() |