summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2006-09-14 21:10:06 +0000
committerChris Lattner <sabre@nondot.org>2006-09-14 21:10:06 +0000
commit4c4e077546f44f88a429c499a98620da014d4065 (patch)
treeca5956f5a97f3d932f72fccbb208e34778028cfb
parent2aa98e0363537ba97e49440a63f7f12a7fc40017 (diff)
downloadbcm5719-llvm-4c4e077546f44f88a429c499a98620da014d4065.tar.gz
bcm5719-llvm-4c4e077546f44f88a429c499a98620da014d4065.zip
New testcase
llvm-svn: 30378
-rw-r--r--llvm/test/Regression/CodeGen/X86/and-or-fold.ll13
1 files changed, 13 insertions, 0 deletions
diff --git a/llvm/test/Regression/CodeGen/X86/and-or-fold.ll b/llvm/test/Regression/CodeGen/X86/and-or-fold.ll
new file mode 100644
index 00000000000..51a3ac64611
--- /dev/null
+++ b/llvm/test/Regression/CodeGen/X86/and-or-fold.ll
@@ -0,0 +1,13 @@
+; RUN: llvm-as < %s | llc -march=x86 | grep and | wc -l | grep 1
+
+; The dag combiner should fold together (x&127)|(y&16711680) -> (x|y)&c1
+; in this case.
+uint %test6(uint %x, ushort %y) {
+ %tmp1 = cast ushort %y to uint
+ %tmp2 = and uint %tmp1, 127 ; <uint> [#uses=1]
+ %tmp4 = shl uint %x, ubyte 16 ; <uint> [#uses=1]
+ %tmp5 = and uint %tmp4, 16711680 ; <uint> [#uses=1]
+ %tmp6 = or uint %tmp2, %tmp5 ; <uint> [#uses=1]
+ ret uint %tmp6
+}
+
OpenPOWER on IntegriCloud