blob: 52d188d9430152fb09385afa646cec0bfff9fe8b [file] [log] [blame]
Dan Gohmanf17a25c2007-07-18 16:29:46 +00001; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 | grep lea
2; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 | not grep add
3
4int %test(int %X, int %Y) {
5 ; Push the shl through the mul to allow an LEA to be formed, instead
6 ; of using a shift and add separately.
7 %tmp.2 = shl int %X, ubyte 1
8 %tmp.3 = mul int %tmp.2, %Y
9 %tmp.5 = add int %tmp.3, %Y
10 ret int %tmp.5
11}
12