[llvm-commits] CVS: llvm/test/Regression/Transforms/InstCombine/2006-10-19-SignedToUnsignedCastAndConst-2.ll

Devang Patel dpatel at apple.com
Thu Oct 19 13:59:28 PDT 2006



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

2006-10-19-SignedToUnsignedCastAndConst-2.ll added (r1.1)
---
Log message:

It is OK to remove extra cast if operation is EQ/NE even though source
and destination sign may not match but other conditions are met.


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

 2006-10-19-SignedToUnsignedCastAndConst-2.ll |    9 +++++++++
 1 files changed, 9 insertions(+)


Index: llvm/test/Regression/Transforms/InstCombine/2006-10-19-SignedToUnsignedCastAndConst-2.ll
diff -c /dev/null llvm/test/Regression/Transforms/InstCombine/2006-10-19-SignedToUnsignedCastAndConst-2.ll:1.1
*** /dev/null	Thu Oct 19 15:59:23 2006
--- llvm/test/Regression/Transforms/InstCombine/2006-10-19-SignedToUnsignedCastAndConst-2.ll	Thu Oct 19 15:59:13 2006
***************
*** 0 ****
--- 1,9 ----
+ ; The optimizer should be able to remove cast operation here.
+ ; RUN: llvm-as %s -o - | opt -instcombine | llvm-dis | not grep 'cast.*int'
+ 
+ bool %eq_signed_to_small_unsigned(sbyte %SB) {
+    %Y = cast sbyte %SB to uint         ; <uint> [#uses=1]
+    %C = seteq uint %Y, 17              ; <bool> [#uses=1]
+    ret bool %C
+  }
+ 






More information about the llvm-commits mailing list