| Evan Cheng | abda665 | 2009-01-25 03:53:59 +0000 | [diff] [blame^] | 1 | ; RUN: llvm-as < %s | llc -march=x86 -join-cross-class-copies -stats |& \ |
| 2 | ; RUN: grep {twoaddrinstr} | grep {Number of instructions aggressively commuted} |
| 3 | ; rdar://6523745 |
| 4 | |
| 5 | @"\01LC" = internal constant [4 x i8] c"%d\0A\00" ; <[4 x i8]*> [#uses=1] |
| 6 | |
| 7 | define i32 @main() nounwind { |
| 8 | bb1.thread: |
| 9 | br label %bb1 |
| 10 | |
| 11 | bb1: ; preds = %bb1, %bb1.thread |
| 12 | %i.0.reg2mem.0 = phi i32 [ 0, %bb1.thread ], [ %indvar.next, %bb1 ] ; <i32> [#uses=2] |
| 13 | %0 = trunc i32 %i.0.reg2mem.0 to i8 ; <i8> [#uses=1] |
| 14 | %1 = sdiv i8 %0, 2 ; <i8> [#uses=1] |
| 15 | %2 = sext i8 %1 to i32 ; <i32> [#uses=1] |
| 16 | %3 = tail call i32 (i8*, ...)* @printf(i8* getelementptr ([4 x i8]* @"\01LC", i32 0, i32 0), i32 %2) nounwind ; <i32> [#uses=0] |
| 17 | %indvar.next = add i32 %i.0.reg2mem.0, 1 ; <i32> [#uses=2] |
| 18 | %exitcond = icmp eq i32 %indvar.next, 258 ; <i1> [#uses=1] |
| 19 | br i1 %exitcond, label %bb2, label %bb1 |
| 20 | |
| 21 | bb2: ; preds = %bb1 |
| 22 | ret i32 0 |
| 23 | } |
| 24 | |
| 25 | declare i32 @printf(i8*, ...) nounwind |