summaryrefslogtreecommitdiffstats
path: root/test/Transforms/InstCombine
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2005-01-01 16:13:19 +0000
committerChris Lattner <sabre@nondot.org>2005-01-01 16:13:19 +0000
commite768ff2cdca504c42b5bf1ab9c7c57b54be381a3 (patch)
treecb9adcfda959b358246265f4f0d3882722a46989 /test/Transforms/InstCombine
parent05b402ce9fc3594fafeccaf46b0bd6cf8698ab3d (diff)
downloadexternal_llvm-e768ff2cdca504c42b5bf1ab9c7c57b54be381a3.zip
external_llvm-e768ff2cdca504c42b5bf1ab9c7c57b54be381a3.tar.gz
external_llvm-e768ff2cdca504c42b5bf1ab9c7c57b54be381a3.tar.bz2
Add a bunch of tests for ANDs that should be eliminated.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19216 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms/InstCombine')
-rw-r--r--test/Transforms/InstCombine/and.ll13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/Transforms/InstCombine/and.ll b/test/Transforms/InstCombine/and.ll
index 67b34a3..b217c7e 100644
--- a/test/Transforms/InstCombine/and.ll
+++ b/test/Transforms/InstCombine/and.ll
@@ -179,3 +179,16 @@ ubyte %test27(ubyte %A) {
%E = add ubyte %D, 16
ret ubyte %E
}
+
+int %test28(int %X) { ;; This is juse a zero extending shr.
+ %Y = shr int %X, ubyte 24 ;; Sign extend
+ %Z = and int %Y, 255 ;; Mask out sign bits
+ ret int %Z
+}
+
+int %test29(ubyte %X) {
+ %Y = cast ubyte %X to int
+ %Z = and int %Y, 255 ;; Zero extend makes this unneeded.
+ ret int %Z
+}
+