On Tue, 2006-12-05 at 11:52 -0800, Chris Lattner wrote: > > SCEVHandle SCEVTruncateExpr::get(const SCEVHandle &Op, const Type > > *Ty) { > > if (SCEVConstant *SC = dyn_cast<SCEVConstant>(Op)) > > - return SCEVUnknown::get(ConstantExpr::getCast(SC->getValue(), > > Ty)); > > + return SCEVUnknown::get( > > + ConstantExpr::getTruncOrBitCast(SC->getValue(), Ty)); > > Shouldn't this one always bit a truncate?
No, they could be the same size. > > > SCEVHandle SCEVZeroExtendExpr::get(const SCEVHandle &Op, const > > Type *Ty) { > > if (SCEVConstant *SC = dyn_cast<SCEVConstant>(Op)) > > - return SCEVUnknown::get(ConstantExpr::getCast(SC->getValue(), > > Ty)); > > + return SCEVUnknown::get( > > + ConstantExpr::getZExtOrBitCast(SC->getValue(), Ty)); > > Likewise, always a zext? No, they could be the same size. > > > @@ -998,11 +1000,10 @@ > > Constant *LHSCV = LHSC->getValue(); > > Constant *RHSCV = RHSC->getValue(); > > if (LHSCV->getType()->isUnsigned()) > > - LHSCV = ConstantExpr::getInferredCast( > > - LHSCV, false, LHSCV->getType()->getSignedVersion(), > > true); > > + LHSCV = ConstantExpr::getBitCast(LHSCV, > > + LHSCV->getType()- > > >getSignedVersion()); > > if (RHSCV->getType()->isUnsigned()) > > - RHSCV = ConstantExpr::getInferredCast( > > - RHSCV, false, LHSCV->getType(), true); > > + RHSCV = ConstantExpr::getBitCast(RHSCV, LHSCV->getType()); > > return SCEVUnknown::get(ConstantExpr::getSDiv(LHSCV, RHSCV)); > > } > > } > > As I mentioned before, these casts can all go away. sdiv is signless > now. One thing at a time. This patch is getting rid of getInferredCast and no more. > > -Chris > _______________________________________________ > llvm-commits mailing list > llvm-commits@cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
signature.asc
Description: This is a digitally signed message part
_______________________________________________ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits