Lines Matching refs:ConstantRange

19 #include "llvm/IR/ConstantRange.h"
74 bool isUnsafe(const ConstantRange &R) {
78 ConstantRange addOverflowNever(const ConstantRange &L, const ConstantRange &R) {
82 ConstantRange::OverflowResult::NeverOverflows)
83 return ConstantRange::getFull(L.getBitWidth());
84 ConstantRange Result = L.add(R);
89 ConstantRange unionNoWrap(const ConstantRange &L, const ConstantRange &R) {
95 Result = ConstantRange::getFull(Result.getBitWidth());
120 ConstantRange Range;
127 // ConstantRange::add
128 using CallsTy = std::map<CallInfo<CalleeTy>, ConstantRange,
134 void updateRange(const ConstantRange &R) { Range = unionNoWrap(Range, R); }
135 void addRange(const Instruction *I, const ConstantRange &R, bool IsSafe) {
154 ConstantRange getStaticAllocaSizeRange(const AllocaInst &AI) {
159 ConstantRange R = ConstantRange::getEmpty(PointerSize);
178 R = ConstantRange(APInt::getZero(PointerSize), APSize);
244 const ConstantRange UnknownRange;
254 ConstantRange offsetFrom(Value *Addr, Value *Base);
255 ConstantRange getAccessRange(Value *Addr, Value *Base,
256 const ConstantRange &SizeRange);
257 ConstantRange getAccessRange(Value *Addr, Value *Base, TypeSize Size);
258 ConstantRange getMemIntrinsicAccessRange(const MemIntrinsic *MI, const Use &U,
293 ConstantRange StackSafetyLocalAnalysis::offsetFrom(Value *Addr, Value *Base) {
306 ConstantRange Offset = SE.getSignedRange(Diff);
312 ConstantRange
314 const ConstantRange &SizeRange) {
317 return ConstantRange::getEmpty(PointerSize);
320 ConstantRange Offsets = offsetFrom(Addr, Base);
330 ConstantRange StackSafetyLocalAnalysis::getAccessRange(Value *Addr, Value *Base,
338 ConstantRange(APInt::getZero(PointerSize), APSize));
341 ConstantRange StackSafetyLocalAnalysis::getMemIntrinsicAccessRange(
345 return ConstantRange::getEmpty(PointerSize);
348 return ConstantRange::getEmpty(PointerSize);
357 ConstantRange Sizes = SE.getSignedRange(Expr);
361 ConstantRange SizeRange(APInt::getZero(PointerSize), Sizes.getUpper() - 1);
537 ConstantRange Offsets = offsetFrom(UI, Ptr);
590 const ConstantRange UnknownRange;
613 UnknownRange(ConstantRange::getFull(PointerBitWidth)) {}
617 ConstantRange getArgumentAccessRange(const CalleeTy *Callee, unsigned ParamNo,
618 const ConstantRange &Offsets) const;
622 ConstantRange StackSafetyDataFlowAnalysis<CalleeTy>::getArgumentAccessRange(
624 const ConstantRange &Offsets) const {
649 ConstantRange CalleeRange =
794 const ConstantRange *findParamAccess(const FunctionSummary &FS,
806 ConstantRange FullSet(Use.Range.getBitWidth(), true);
828 const ConstantRange *Found = findParamAccess(*FS, C.first.ParamNo);
831 ConstantRange Access = Found->sextOrTrunc(Use.Range.getBitWidth());
1139 const ConstantRange FullSet(FunctionSummary::ParamAccess::RangeWidth, true);