summaryrefslogtreecommitdiffstats
path: root/test/Transforms/InstCombine/2006-10-19-SignedToUnsignedCastAndConst-2.ll
diff options
context:
space:
mode:
authorDevang Patel <dpatel@apple.com>2006-10-19 20:59:13 +0000
committerDevang Patel <dpatel@apple.com>2006-10-19 20:59:13 +0000
commit002e499650ee97df34dd53f1a6806860132a256c (patch)
treec1c32c2e264b34ef50e9233ba8511c739a5db950 /test/Transforms/InstCombine/2006-10-19-SignedToUnsignedCastAndConst-2.ll
parentdf308fa7aba36d9c7ca29abe24489adbcdfff697 (diff)
downloadexternal_llvm-002e499650ee97df34dd53f1a6806860132a256c.zip
external_llvm-002e499650ee97df34dd53f1a6806860132a256c.tar.gz
external_llvm-002e499650ee97df34dd53f1a6806860132a256c.tar.bz2
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31056 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms/InstCombine/2006-10-19-SignedToUnsignedCastAndConst-2.ll')
-rw-r--r--test/Transforms/InstCombine/2006-10-19-SignedToUnsignedCastAndConst-2.ll9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/Transforms/InstCombine/2006-10-19-SignedToUnsignedCastAndConst-2.ll b/test/Transforms/InstCombine/2006-10-19-SignedToUnsignedCastAndConst-2.ll
new file mode 100644
index 0000000..c10e62d
--- /dev/null
+++ b/test/Transforms/InstCombine/2006-10-19-SignedToUnsignedCastAndConst-2.ll
@@ -0,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
+ }
+