52d188d9430152fb09385afa646cec0bfff9fe8b
[oota-llvm.git] / test / CodeGen / X86 / mul-shift-reassoc.ll
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