[llvm-commits] CVS: llvm/test/Regression/Transforms/Reassociate/shift-factor.ll
Chris Lattner
lattner at cs.uiuc.edu
Mon Mar 13 22:54:44 PST 2006
Changes in directory llvm/test/Regression/Transforms/Reassociate:
shift-factor.ll added (r1.1)
---
Log message:
Test that we can reassociate (x<<1)+(y<<1) -> (X+Y)<<1.
---
Diffs of the changes: (+11 -0)
shift-factor.ll | 11 +++++++++++
1 files changed, 11 insertions(+)
Index: llvm/test/Regression/Transforms/Reassociate/shift-factor.ll
diff -c /dev/null llvm/test/Regression/Transforms/Reassociate/shift-factor.ll:1.1
*** /dev/null Tue Mar 14 00:54:42 2006
--- llvm/test/Regression/Transforms/Reassociate/shift-factor.ll Tue Mar 14 00:54:32 2006
***************
*** 0 ****
--- 1,11 ----
+ ; There should be exactly one shift and one add left.
+ ; RUN: llvm-as < %s | opt -reassociate -instcombine | llvm-dis | grep shl | wc -l | grep 1 &&
+ ; RUN: llvm-as < %s | opt -reassociate -instcombine | llvm-dis | grep add | wc -l | grep 1
+
+ int %test(int %X, int %Y) {
+ %tmp.2 = shl int %X, ubyte 1 ; <int> [#uses=1]
+ %tmp.6 = shl int %Y, ubyte 1 ; <int> [#uses=1]
+ %tmp.4 = add int %tmp.6, %tmp.2 ; <int> [#uses=1]
+ ret int %tmp.4
+ }
+
More information about the llvm-commits
mailing list