Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 1 | ; 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 | |||||
4 | int %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 |