diff options
author | Devang Patel <dpatel@apple.com> | 2006-10-19 20:59:13 +0000 |
---|---|---|
committer | Devang Patel <dpatel@apple.com> | 2006-10-19 20:59:13 +0000 |
commit | 002e499650ee97df34dd53f1a6806860132a256c (patch) | |
tree | c1c32c2e264b34ef50e9233ba8511c739a5db950 /lib/Transforms | |
parent | df308fa7aba36d9c7ca29abe24489adbcdfff697 (diff) | |
download | external_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 'lib/Transforms')
-rw-r--r-- | lib/Transforms/Scalar/InstructionCombining.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/Transforms/Scalar/InstructionCombining.cpp b/lib/Transforms/Scalar/InstructionCombining.cpp index 7e75dca..97b7ceb 100644 --- a/lib/Transforms/Scalar/InstructionCombining.cpp +++ b/lib/Transforms/Scalar/InstructionCombining.cpp @@ -4795,8 +4795,9 @@ Instruction *InstCombiner::visitSetCondInstWithCastAndCast(SetCondInst &SCI) { // %B = setgt short %X, 1330 // // because %A may have negative value. - // However, it is OK if SrcTy is bool. See cast-set.ll testcase. - if (isSignSrc == isSignDest || SrcTy == Type::BoolTy) + // However, it is OK if SrcTy is bool (See cast-set.ll testcase) + // OR operation is EQ/NE. + if (isSignSrc == isSignDest || SrcTy == Type::BoolTy || SCI.isEquality()) RHSCIOp = Res; else return 0; |