Hrm, really, all tests passed without this, but it is scary to think how...

llvm-svn: 16568
This commit is contained in:
Chris Lattner 2004-09-29 03:16:24 +00:00
parent be7a69ebd8
commit c949128b2f
1 changed files with 2 additions and 2 deletions

View File

@ -1766,9 +1766,9 @@ Instruction *InstCombiner::visitSetCondInst(BinaryOperator &I) {
case Instruction::Cast: { // (setcc (cast X to larger), CI)
const Type *SrcTy = LHSI->getOperand(0)->getType();
if (SrcTy->isIntegral() && LHSI->getType()->isIntegral()) {
unsigned SrcBits = SrcTy->getPrimitiveSize();
unsigned SrcBits = SrcTy->getPrimitiveSize()*8;
if (SrcTy == Type::BoolTy) SrcBits = 1;
unsigned DestBits = LHSI->getType()->getPrimitiveSize();
unsigned DestBits = LHSI->getType()->getPrimitiveSize()*8;
if (LHSI->getType() == Type::BoolTy) DestBits = 1;
if (SrcBits < DestBits) {
// Check to see if the comparison is always true or false.