[llvm-commits] CVS: llvm/test/Regression/Transforms/InstCombine/cast.ll

Chris Lattner lattner at cs.uiuc.edu
Sat Jan 1 08:13:56 PST 2005



Changes in directory llvm/test/Regression/Transforms/InstCombine:

cast.ll updated: 1.22 -> 1.23
---
Log message:

Add a bunch of tests for cases that should be eliminated.


---
Diffs of the changes:  (+27 -0)

Index: llvm/test/Regression/Transforms/InstCombine/cast.ll
diff -u llvm/test/Regression/Transforms/InstCombine/cast.ll:1.22 llvm/test/Regression/Transforms/InstCombine/cast.ll:1.23
--- llvm/test/Regression/Transforms/InstCombine/cast.ll:1.22	Tue Sep 28 22:18:20 2004
+++ llvm/test/Regression/Transforms/InstCombine/cast.ll	Sat Jan  1 10:13:43 2005
@@ -128,3 +128,30 @@
 	%D = setlt int %C, -1
 	ret bool %D                ;; false
 }
+
+uint %test21(uint %X) {
+	%Y = cast uint %X to sbyte
+	%Z = cast sbyte %Y to uint ;; sext -> zext -> and -> nop
+	%RV = and uint %Z, 255
+	ret uint %RV
+}
+
+uint %test22(uint %X) {
+	%Y = cast uint %X to sbyte
+	%Z = cast sbyte %Y to uint ;; sext -> zext -> and -> nop
+	%RV = shl uint %Z, ubyte 24
+	ret uint %RV
+}
+
+int %test23(int %X) {
+	%Y = cast int %X to ushort  ;; Turn into an AND even though X
+	%Z = cast ushort %Y to int  ;; and Z are signed.
+	ret int %Z
+}
+
+bool %test24(bool %C) {
+        %X = select bool %C, uint 14, uint 1234
+        %Y = cast uint %X to bool                  ;; Fold cast into select
+        ret bool %Y
+}
+






More information about the llvm-commits mailing list