blob: 44413d60785eaf84725c191f9c4a1b472997fcdc [file] [log] [blame]
Dan Gohman0a063102009-09-08 23:54:48 +00001; RUN: llc < %s -march=x86-64 | grep {leal (%rdi,%rdi,2), %eax}
Dan Gohmanf17a25c2007-07-18 16:29:46 +00002define i32 @test(i32 %a) {
3 %tmp2 = mul i32 %a, 3 ; <i32> [#uses=1]
4 ret i32 %tmp2
5}
6
Dan Gohman0a063102009-09-08 23:54:48 +00007; RUN: llc < %s -march=x86-64 | grep {leaq (,%rdi,4), %rax}
Dan Gohmanf17a25c2007-07-18 16:29:46 +00008define i64 @test2(i64 %a) {
9 %tmp2 = shl i64 %a, 2
10 %tmp3 = or i64 %tmp2, %a
11 ret i64 %tmp3
12}
13
14;; TODO! LEA instead of shift + copy.
15define i64 @test3(i64 %a) {
16 %tmp2 = shl i64 %a, 3
17 ret i64 %tmp2
18}
19