Lines Matching refs:Val
84 Constant *Val; member in __anon50e03b1b0111::LVILatticeVal
88 LVILatticeVal() : Tag(undefined), Val(nullptr), Range(1, true) {} in LVILatticeVal()
116 return Val; in getConstant()
121 return Val; in getNotConstant()
150 Val = V; in markConstant()
168 Val = V; in markNotConstant()
200 Val = RHS.Val; in mergeIn()
207 if (Val == RHS.Val) in mergeIn()
213 if (Val == RHS.Val) in mergeIn()
237 if (Val == RHS.Val) in mergeIn()
252 if (Val == RHS.Val) in mergeIn()
274 raw_ostream &operator<<(raw_ostream &OS, const LVILatticeVal &Val)
276 raw_ostream &operator<<(raw_ostream &OS, const LVILatticeVal &Val) { in operator <<() argument
277 if (Val.isUndefined()) in operator <<()
279 if (Val.isOverdefined()) in operator <<()
282 if (Val.isNotConstant()) in operator <<()
283 return OS << "notconstant<" << *Val.getNotConstant() << '>'; in operator <<()
284 else if (Val.isConstantRange()) in operator <<()
285 return OS << "constantrange<" << Val.getConstantRange().getLower() << ", " in operator <<()
286 << Val.getConstantRange().getUpper() << '>'; in operator <<()
287 return OS << "constant<" << *Val.getConstant() << '>'; in operator <<()
358 void insertResult(Value *Val, BasicBlock *BB, const LVILatticeVal &Result) { in insertResult() argument
360 lookup(Val)[BB] = Result; in insertResult() local
362 OverDefinedCache.insert(std::make_pair(BB, Val)); in insertResult()
365 LVILatticeVal getBlockValue(Value *Val, BasicBlock *BB);
369 bool hasBlockValue(Value *Val, BasicBlock *BB);
374 bool solveBlockValue(Value *Val, BasicBlock *BB);
376 Value *Val, BasicBlock *BB);
381 void mergeAssumeBlockValueConstantRange(Value *Val, LVILatticeVal &BBLV,
480 bool LazyValueInfoCache::hasBlockValue(Value *Val, BasicBlock *BB) { in hasBlockValue() argument
482 if (isa<Constant>(Val)) in hasBlockValue()
485 LVIValueHandle ValHandle(Val, this); in hasBlockValue()
492 LVILatticeVal LazyValueInfoCache::getBlockValue(Value *Val, BasicBlock *BB) { in getBlockValue() argument
494 if (Constant *VC = dyn_cast<Constant>(Val)) in getBlockValue()
498 return lookup(Val)[BB]; in getBlockValue()
501 bool LazyValueInfoCache::solveBlockValue(Value *Val, BasicBlock *BB) { in solveBlockValue() argument
502 if (isa<Constant>(Val)) in solveBlockValue()
505 if (lookup(Val).count(BB)) { in solveBlockValue()
508 << "' val=" << lookup(Val)[BB] << '\n'); in solveBlockValue()
520 Instruction *BBI = dyn_cast<Instruction>(Val); in solveBlockValue()
522 if (!solveBlockValueNonLocal(Res, Val, BB)) in solveBlockValue()
524 insertResult(Val, BB, Res); in solveBlockValue()
531 insertResult(Val, BB, Res); in solveBlockValue()
537 insertResult(Val, BB, Res); in solveBlockValue()
549 insertResult(Val, BB, Res); in solveBlockValue()
561 insertResult(Val, BB, Res); in solveBlockValue()
567 insertResult(Val, BB, Res); in solveBlockValue()
603 Value *Val, BasicBlock *BB) { in solveBlockValueNonLocal() argument
609 if (Val->getType()->isPointerTy()) { in solveBlockValueNonLocal()
610 if (isKnownNonNull(Val)) { in solveBlockValueNonLocal()
614 Value *UnderlyingVal = GetUnderlyingObject(Val, DL); in solveBlockValueNonLocal()
631 assert(isa<Argument>(Val) && "Unknown live-in to the entry block"); in solveBlockValueNonLocal()
633 PointerType *PTy = cast<PointerType>(Val->getType()); in solveBlockValueNonLocal()
647 EdgesMissing |= !getEdgeValue(Val, *PI, BB, EdgeResult); in solveBlockValueNonLocal()
661 PointerType *PTy = cast<PointerType>(Val->getType()); in solveBlockValueNonLocal()
717 static bool getValueFromFromCondition(Value *Val, ICmpInst *ICI,
724 void LazyValueInfoCache::mergeAssumeBlockValueConstantRange(Value *Val, in mergeAssumeBlockValueConstantRange() argument
727 BBI = BBI ? BBI : dyn_cast<Instruction>(Val); in mergeAssumeBlockValueConstantRange()
741 if (getValueFromFromCondition(Val, ICI, Result)) { in mergeAssumeBlockValueConstantRange()
835 bool getValueFromFromCondition(Value *Val, ICmpInst *ICI, in getValueFromFromCondition() argument
838 if (ICI->isEquality() && ICI->getOperand(0) == Val) { in getValueFromFromCondition()
852 match(ICI->getOperand(0), m_Add(m_Specific(Val), in getValueFromFromCondition()
856 if (CI && (ICI->getOperand(0) == Val || NegOffset)) { in getValueFromFromCondition()
878 static bool getEdgeValueLocal(Value *Val, BasicBlock *BBFrom, in getEdgeValueLocal() argument
893 if (BI->getCondition() == Val) { in getEdgeValueLocal()
895 Type::getInt1Ty(Val->getContext()), isTrueDest)); in getEdgeValueLocal()
902 if (getValueFromFromCondition(Val, ICI, Result, isTrueDest)) in getEdgeValueLocal()
910 if (SI->getCondition() != Val) in getEdgeValueLocal()
914 unsigned BitWidth = Val->getType()->getIntegerBitWidth(); in getEdgeValueLocal()
935 bool LazyValueInfoCache::getEdgeValue(Value *Val, BasicBlock *BBFrom, in getEdgeValue() argument
939 if (Constant *VC = dyn_cast<Constant>(Val)) { in getEdgeValue()
944 if (getEdgeValueLocal(Val, BBFrom, BBTo, Result)) { in getEdgeValue()
952 if (!hasBlockValue(Val, BBFrom)) { in getEdgeValue()
953 if (pushBlockValue(std::make_pair(BBFrom, Val))) in getEdgeValue()
960 LVILatticeVal InBlock = getBlockValue(Val, BBFrom); in getEdgeValue()
961 mergeAssumeBlockValueConstantRange(Val, InBlock, BBFrom->getTerminator()); in getEdgeValue()
964 mergeAssumeBlockValueConstantRange(Val, InBlock, CxtI); in getEdgeValue()
974 if (!hasBlockValue(Val, BBFrom)) { in getEdgeValue()
975 if (pushBlockValue(std::make_pair(BBFrom, Val))) in getEdgeValue()
982 Result = getBlockValue(Val, BBFrom); in getEdgeValue()
983 mergeAssumeBlockValueConstantRange(Val, Result, BBFrom->getTerminator()); in getEdgeValue()
992 mergeAssumeBlockValueConstantRange(Val, Result, CxtI); in getEdgeValue()