diff options
| author | Reid Spencer <rspencer@reidspencer.com> | 2006-11-30 23:13:36 +0000 | 
|---|---|---|
| committer | Reid Spencer <rspencer@reidspencer.com> | 2006-11-30 23:13:36 +0000 | 
| commit | ad05ee9f39aabfcfd2ce2f477b0a6f8ba3ff6011 (patch) | |
| tree | 2a4d1e84caef71e8aa22655a706845faf38500f3 /llvm/lib/Transforms | |
| parent | 6dbdfe2baae95b4e203d557c586a244ccdd60c09 (diff) | |
| download | bcm5719-llvm-ad05ee9f39aabfcfd2ce2f477b0a6f8ba3ff6011.tar.gz bcm5719-llvm-ad05ee9f39aabfcfd2ce2f477b0a6f8ba3ff6011.zip | |
Remove 4 FIXMEs to hack around cast-to-bool problems which no longer exist.
llvm-svn: 32051
Diffstat (limited to 'llvm/lib/Transforms')
| -rw-r--r-- | llvm/lib/Transforms/Scalar/InstructionCombining.cpp | 49 | 
1 files changed, 3 insertions, 46 deletions
| diff --git a/llvm/lib/Transforms/Scalar/InstructionCombining.cpp b/llvm/lib/Transforms/Scalar/InstructionCombining.cpp index f20d0dd21ab..c8f69959b60 100644 --- a/llvm/lib/Transforms/Scalar/InstructionCombining.cpp +++ b/llvm/lib/Transforms/Scalar/InstructionCombining.cpp @@ -5778,13 +5778,6 @@ Instruction *InstCombiner::commonIntCastTransforms(CastInst &CI) {    unsigned SrcBitSize = SrcTy->getPrimitiveSizeInBits();    unsigned DestBitSize = DestTy->getPrimitiveSizeInBits(); -  // FIXME. We currently implement cast-to-bool as a setne %X, 0. This is  -  // because codegen cannot accurately perform a truncate to bool operation. -  // Something goes wrong in promotion to a larger type. When CodeGen can -  // handle a proper truncation to bool, this should be removed. -  if (DestTy == Type::BoolTy) -    return BinaryOperator::createSetNE(Src, Constant::getNullValue(SrcTy));  -    // See if we can simplify any instructions used by the LHS whose sole     // purpose is to compute bits we don't care about.    uint64_t KnownZero = 0, KnownOne = 0; @@ -6092,35 +6085,11 @@ Instruction *InstCombiner::visitFPExt(CastInst &CI) {  }  Instruction *InstCombiner::visitFPToUI(CastInst &CI) { -  if (Instruction *I = commonCastTransforms(CI)) -    return I; - -  // FIXME. We currently implement cast-to-bool as a setne %X, 0. This is  -  // because codegen cannot accurately perform a truncate to bool operation. -  // Something goes wrong in promotion to a larger type. When CodeGen can -  // handle a proper truncation to bool, this should be removed. -  Value *Src = CI.getOperand(0); -  const Type *SrcTy = Src->getType(); -  const Type *DestTy = CI.getType(); -  if (DestTy == Type::BoolTy) -    return BinaryOperator::createSetNE(Src, Constant::getNullValue(SrcTy));  -  return 0; +  return commonCastTransforms(CI);  }  Instruction *InstCombiner::visitFPToSI(CastInst &CI) { -  if (Instruction *I = commonCastTransforms(CI)) -    return I; - -  // FIXME. We currently implement cast-to-bool as a setne %X, 0. This is  -  // because codegen cannot accurately perform a truncate to bool operation. -  // Something goes wrong in promotion to a larger type. When CodeGen can -  // handle a proper truncation to bool, this should be removed. -  Value *Src = CI.getOperand(0); -  const Type *SrcTy = Src->getType(); -  const Type *DestTy = CI.getType(); -  if (DestTy == Type::BoolTy) -    return BinaryOperator::createSetNE(Src, Constant::getNullValue(SrcTy));  -  return 0; +  return commonCastTransforms(CI);  }  Instruction *InstCombiner::visitUIToFP(CastInst &CI) { @@ -6132,19 +6101,7 @@ Instruction *InstCombiner::visitSIToFP(CastInst &CI) {  }  Instruction *InstCombiner::visitPtrToInt(CastInst &CI) { -  if (Instruction *I = commonCastTransforms(CI)) -    return I; - -  // FIXME. We currently implement cast-to-bool as a setne %X, 0. This is  -  // because codegen cannot accurately perform a truncate to bool operation. -  // Something goes wrong in promotion to a larger type. When CodeGen can -  // handle a proper truncation to bool, this should be removed. -  Value *Src = CI.getOperand(0); -  const Type *SrcTy = Src->getType(); -  const Type *DestTy = CI.getType(); -  if (DestTy == Type::BoolTy) -    return BinaryOperator::createSetNE(Src, Constant::getNullValue(SrcTy));  -  return 0; +  return commonCastTransforms(CI);  }  Instruction *InstCombiner::visitIntToPtr(CastInst &CI) { | 

