- Value *visitTruncateExpr(SCEVTruncateExpr *S) {
- Value *V = expand(S->getOperand());
- return CastInst::CreateTruncOrBitCast(V, S->getType(), "tmp.", InsertPt);
- }
+ /// InsertNoopCastOfTo - Insert a cast of V to the specified type,
+ /// which must be possible with a noop cast, doing what we can to
+ /// share the casts.
+ Value *InsertNoopCastOfTo(Value *V, const Type *Ty);
+
+ /// expandAddToGEP - Expand a SCEVAddExpr with a pointer type into a GEP
+ /// instead of using ptrtoint+arithmetic+inttoptr.
+ Value *expandAddToGEP(const SCEV *const *op_begin,
+ const SCEV *const *op_end,
+ const PointerType *PTy, const Type *Ty, Value *V);
+
+ Value *expand(const SCEV *S);
+
+ /// expandCodeFor - Insert code to directly compute the specified SCEV
+ /// expression into the program. The inserted code is inserted into the
+ /// SCEVExpander's current insertion point. If a type is specified, the
+ /// result will be expanded to have that type, with a cast if necessary.
+ Value *expandCodeFor(const SCEV *SH, const Type *Ty = 0);