Fix flawed logic that was breaking several SPEC benchmarks, including gzip and crafty.

llvm-svn: 9731
This commit is contained in:
Chris Lattner 2003-11-05 17:31:36 +00:00
parent e5b358c829
commit 7c94d1171a
1 changed files with 3 additions and 3 deletions

View File

@ -1337,8 +1337,8 @@ Instruction *InstCombiner::visitSetCondInst(BinaryOperator &I) {
// because the source would be zero extended.
unsigned SrcBits =
SrcTy == Type::BoolTy ? 1 : SrcTy->getPrimitiveSize()*8;
bool HasSignBit = 1ULL << (DestTy->getPrimitiveSize()*8-1);
if (ConstVal & ((1ULL << SrcBits)-1)) {
bool HasSignBit = ConstVal & (1ULL << (DestTy->getPrimitiveSize()*8-1));
if (ConstVal & ~((1ULL << SrcBits)-1)) {
switch (I.getOpcode()) {
default: assert(0 && "Unknown comparison type!");
case Instruction::SetEQ: