Please use GitHub pull requests for new patches. Avoid migrating existing patches. Phabricator shutdown timeline
Changeset View
Changeset View
Standalone View
Standalone View
llvm/lib/Analysis/ScalarEvolution.cpp
- This file is larger than 256 KB, so syntax highlighting is disabled by default.
Show First 20 Lines • Show All 474 Lines • ▼ Show 20 Lines | |||||
SCEVCouldNotCompute::SCEVCouldNotCompute() : | SCEVCouldNotCompute::SCEVCouldNotCompute() : | ||||
SCEV(FoldingSetNodeIDRef(), scCouldNotCompute, 0) {} | SCEV(FoldingSetNodeIDRef(), scCouldNotCompute, 0) {} | ||||
bool SCEVCouldNotCompute::classof(const SCEV *S) { | bool SCEVCouldNotCompute::classof(const SCEV *S) { | ||||
return S->getSCEVType() == scCouldNotCompute; | return S->getSCEVType() == scCouldNotCompute; | ||||
} | } | ||||
const SCEV *ScalarEvolution::getConstant(ConstantInt *V) { | const SCEVConstant *ScalarEvolution::getConstant(ConstantInt *V) { | ||||
FoldingSetNodeID ID; | FoldingSetNodeID ID; | ||||
ID.AddInteger(scConstant); | ID.AddInteger(scConstant); | ||||
ID.AddPointer(V); | ID.AddPointer(V); | ||||
void *IP = nullptr; | void *IP = nullptr; | ||||
if (const SCEV *S = UniqueSCEVs.FindNodeOrInsertPos(ID, IP)) return S; | if (const SCEV *S = UniqueSCEVs.FindNodeOrInsertPos(ID, IP)) | ||||
SCEV *S = new (SCEVAllocator) SCEVConstant(ID.Intern(SCEVAllocator), V); | return cast<SCEVConstant>(S); | ||||
mkazantsev: `cast` | |||||
SCEVConstant *S = | |||||
new (SCEVAllocator) SCEVConstant(ID.Intern(SCEVAllocator), V); | |||||
UniqueSCEVs.InsertNode(S, IP); | UniqueSCEVs.InsertNode(S, IP); | ||||
return S; | return S; | ||||
} | } | ||||
const SCEV *ScalarEvolution::getConstant(const APInt &Val) { | const SCEVConstant *ScalarEvolution::getConstant(const APInt &Val) { | ||||
return getConstant(ConstantInt::get(getContext(), Val)); | return getConstant(ConstantInt::get(getContext(), Val)); | ||||
} | } | ||||
const SCEV * | const SCEVConstant *ScalarEvolution::getConstant(Type *Ty, uint64_t V, | ||||
ScalarEvolution::getConstant(Type *Ty, uint64_t V, bool isSigned) { | bool isSigned) { | ||||
IntegerType *ITy = cast<IntegerType>(getEffectiveSCEVType(Ty)); | IntegerType *ITy = cast<IntegerType>(getEffectiveSCEVType(Ty)); | ||||
return getConstant(ConstantInt::get(ITy, V, isSigned)); | return getConstant(ConstantInt::get(ITy, V, isSigned)); | ||||
} | } | ||||
SCEVCastExpr::SCEVCastExpr(const FoldingSetNodeIDRef ID, SCEVTypes SCEVTy, | SCEVCastExpr::SCEVCastExpr(const FoldingSetNodeIDRef ID, SCEVTypes SCEVTy, | ||||
const SCEV *op, Type *ty) | const SCEV *op, Type *ty) | ||||
: SCEV(ID, SCEVTy, computeExpressionSize(op)), Op(op), Ty(ty) {} | : SCEV(ID, SCEVTy, computeExpressionSize(op)), Op(op), Ty(ty) {} | ||||
▲ Show 20 Lines • Show All 14,675 Lines • Show Last 20 Lines |
cast