Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 1 | |
Dan Gohman | 91888f0 | 2007-07-31 20:11:57 +0000 | [diff] [blame] | 2 | ; RUN: llvm-as < %s | llc -march=x86-64 | grep {leal (%rdi,%rdi,2), %eax} |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 3 | define i32 @test(i32 %a) { |
| 4 | %tmp2 = mul i32 %a, 3 ; <i32> [#uses=1] |
| 5 | ret i32 %tmp2 |
| 6 | } |
| 7 | |
Dan Gohman | 91888f0 | 2007-07-31 20:11:57 +0000 | [diff] [blame] | 8 | ; RUN: llvm-as < %s | llc -march=x86-64 | grep {leaq (,%rdi,4), %rax} |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 9 | define i64 @test2(i64 %a) { |
| 10 | %tmp2 = shl i64 %a, 2 |
| 11 | %tmp3 = or i64 %tmp2, %a |
| 12 | ret i64 %tmp3 |
| 13 | } |
| 14 | |
| 15 | ;; TODO! LEA instead of shift + copy. |
| 16 | define i64 @test3(i64 %a) { |
| 17 | %tmp2 = shl i64 %a, 3 |
| 18 | ret i64 %tmp2 |
| 19 | } |
| 20 | |