Reid Spencer | eb1d74e | 2007-04-16 17:36:08 +0000 | [diff] [blame] | 1 | ; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 | grep lea |
Reid Spencer | 69ccadd | 2006-12-02 04:23:10 +0000 | [diff] [blame] | 2 | ; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 | not grep add |
Chris Lattner | cf6a9fb | 2006-03-01 03:43:38 +0000 | [diff] [blame] | 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 | |