llvm.org GIT mirror llvm / 95f6553
new testcase from a FIXME in the code git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26756 91177308-0d34-0410-b5e6-96231b3b80d8 Chris Lattner 13 years ago
2 changed file(s) with 16 addition(s) and 2 deletion(s). Raw diff Collapse all Expand all
0 ; This should be one add and two multiplies.
1
2 ; RUN: llvm-as < %s | opt -reassociate -instcombine | llvm-dis | grep mul | wc -l | grep 2 &&
3 ; RUN: llvm-as < %s | opt -reassociate -instcombine | llvm-dis | grep add | wc -l | grep 1
4
5 int %test(int %A, int %B, int %C) {
6 %aa = mul int %A, %A
7 %aab = mul int %aa, %B
8
9 %ac = mul int %A, %C
10 %aac = mul int %ac, %A
11 %r = add int %aab, %aac
12 ret int %r
13 }
0 ; This should turn into one multiply and one add.
11
2 ; RUN: llvm-as < mulfactor2.ll | opt -instcombine -reassociate -instcombine | llvm-dis | grep mul | wc -l | grep 1 &&
3 ; RUN: llvm-as < mulfactor2.ll | opt -instcombine -reassociate -instcombine | llvm-dis | grep add | wc -l | grep 1
2 ; RUN: llvm-as < %s | opt -instcombine -reassociate -instcombine | llvm-dis | grep mul | wc -l | grep 1 &&
3 ; RUN: llvm-as < %s | opt -instcombine -reassociate -instcombine | llvm-dis | grep add | wc -l | grep 1
44 int %main(int %t) {
55 %tmp.3 = mul int %t, 12 ; [#uses=1]
66 %tmp.4 = add int %tmp.3, 5 ; [#uses=1]