[llvm-commits] CVS: llvm/test/Regression/Transforms/InstCombine/and.ll
Chris Lattner
lattner at cs.uiuc.edu
Fri Sep 24 08:18:56 PDT 2004
Changes in directory llvm/test/Regression/Transforms/InstCombine:
and.ll updated: 1.20 -> 1.21
---
Log message:
Add some tests for shr-and folding
---
Diffs of the changes: (+17 -0)
Index: llvm/test/Regression/Transforms/InstCombine/and.ll
diff -u llvm/test/Regression/Transforms/InstCombine/and.ll:1.20 llvm/test/Regression/Transforms/InstCombine/and.ll:1.21
--- llvm/test/Regression/Transforms/InstCombine/and.ll:1.20 Thu Sep 23 16:42:49 2004
+++ llvm/test/Regression/Transforms/InstCombine/and.ll Fri Sep 24 10:18:43 2004
@@ -119,3 +119,20 @@
ret bool %C
}
+int %test19(int %A) {
+ %B = shl int %A, ubyte 3
+ %C = and int %B, -2 ;; Clearing a zero bit
+ ret int %C
+}
+
+ubyte %test20(ubyte %A) {
+ %C = shr ubyte %A, ubyte 7
+ %D = and ubyte %C, 1 ;; Unneeded
+ ret ubyte %D
+}
+
+sbyte %test21(sbyte %A) {
+ %C = shr sbyte %A, ubyte 7 ;; sign extend
+ %D = and sbyte %C, 1 ;; chop off sign
+ ret sbyte %D
+}
More information about the llvm-commits
mailing list