Lines Matching refs:Val
67 static bool hasSingleValue(const ValueLatticeElement &Val) { in hasSingleValue() argument
68 if (Val.isConstantRange() && in hasSingleValue()
69 Val.getConstantRange().isSingleElement()) in hasSingleValue()
72 if (Val.isConstant()) in hasSingleValue()
181 void insertResult(Value *Val, BasicBlock *BB, in insertResult() argument
188 OverDefinedCache[BB].insert(Val); in insertResult()
190 auto It = ValueCache.find_as(Val); in insertResult()
192 ValueCache[Val] = make_unique<ValueCacheEntryTy>(Val, this); in insertResult()
193 It = ValueCache.find_as(Val); in insertResult()
407 ValueLatticeElement getBlockValue(Value *Val, BasicBlock *BB);
410 bool hasBlockValue(Value *Val, BasicBlock *BB);
415 bool solveBlockValue(Value *Val, BasicBlock *BB);
416 bool solveBlockValueImpl(ValueLatticeElement &Res, Value *Val,
418 bool solveBlockValueNonLocal(ValueLatticeElement &BBLV, Value *Val,
430 void intersectAssumeOrGuardBlockValueConstantRange(Value *Val,
549 bool LazyValueInfoImpl::hasBlockValue(Value *Val, BasicBlock *BB) { in hasBlockValue() argument
551 if (isa<Constant>(Val)) in hasBlockValue()
554 return TheCache.hasCachedValueInfo(Val, BB); in hasBlockValue()
557 ValueLatticeElement LazyValueInfoImpl::getBlockValue(Value *Val, in getBlockValue() argument
560 if (Constant *VC = dyn_cast<Constant>(Val)) in getBlockValue()
563 return TheCache.getCachedValueInfo(Val, BB); in getBlockValue()
583 bool LazyValueInfoImpl::solveBlockValue(Value *Val, BasicBlock *BB) { in solveBlockValue() argument
584 if (isa<Constant>(Val)) in solveBlockValue()
587 if (TheCache.hasCachedValueInfo(Val, BB)) { in solveBlockValue()
590 << TheCache.getCachedValueInfo(Val, BB) << '\n'); in solveBlockValue()
601 if (!solveBlockValueImpl(Res, Val, BB)) in solveBlockValue()
605 TheCache.insertResult(Val, BB, Res); in solveBlockValue()
610 Value *Val, BasicBlock *BB) { in solveBlockValueImpl() argument
612 Instruction *BBI = dyn_cast<Instruction>(Val); in solveBlockValueImpl()
614 return solveBlockValueNonLocal(Res, Val, BB); in solveBlockValueImpl()
685 static bool isObjectDereferencedInBlock(Value *Val, BasicBlock *BB) { in isObjectDereferencedInBlock() argument
686 assert(Val->getType()->isPointerTy()); in isObjectDereferencedInBlock()
689 Value *UnderlyingVal = GetUnderlyingObject(Val, DL); in isObjectDereferencedInBlock()
700 Value *Val, BasicBlock *BB) { in solveBlockValueNonLocal() argument
706 assert(isa<Argument>(Val) && "Unknown live-in to the entry block"); in solveBlockValueNonLocal()
709 PointerType *PTy = dyn_cast<PointerType>(Val->getType()); in solveBlockValueNonLocal()
711 (isKnownNonZero(Val, DL) || in solveBlockValueNonLocal()
712 (isObjectDereferencedInBlock(Val, BB) && in solveBlockValueNonLocal()
733 if (!getEdgeValue(Val, *PI, BB, EdgeResult)) in solveBlockValueNonLocal()
746 PointerType *PTy = dyn_cast<PointerType>(Val->getType()); in solveBlockValueNonLocal()
747 if (PTy && isObjectDereferencedInBlock(Val, BB) && in solveBlockValueNonLocal()
800 static ValueLatticeElement getValueFromCondition(Value *Val, Value *Cond,
806 Value *Val, ValueLatticeElement &BBLV, Instruction *BBI) { in intersectAssumeOrGuardBlockValueConstantRange() argument
807 BBI = BBI ? BBI : dyn_cast<Instruction>(Val); in intersectAssumeOrGuardBlockValueConstantRange()
811 for (auto &AssumeVH : AC->assumptionsFor(Val)) { in intersectAssumeOrGuardBlockValueConstantRange()
818 BBLV = intersect(BBLV, getValueFromCondition(Val, I->getArgOperand(0))); in intersectAssumeOrGuardBlockValueConstantRange()
831 BBLV = intersect(BBLV, getValueFromCondition(Val, Cond)); in intersectAssumeOrGuardBlockValueConstantRange()
967 ValueLatticeElement Val = getBlockValue(I->getOperand(Op), BB); in getRangeForOperand() local
968 intersectAssumeOrGuardBlockValueConstantRange(I->getOperand(Op), Val, I); in getRangeForOperand()
969 if (Val.isConstantRange()) in getRangeForOperand()
970 Range = Val.getConstantRange(); in getRangeForOperand()
1073 static ValueLatticeElement getValueFromICmpCondition(Value *Val, ICmpInst *ICI, in getValueFromICmpCondition() argument
1080 if (ICI->isEquality() && LHS == Val) { in getValueFromICmpCondition()
1090 if (!Val->getType()->isIntegerTy()) in getValueFromICmpCondition()
1102 if (LHS != Val && !match(LHS, m_Add(m_Specific(Val), m_ConstantInt()))) { in getValueFromICmpCondition()
1108 if (LHS != Val) in getValueFromICmpCondition()
1109 match(LHS, m_Add(m_Specific(Val), m_ConstantInt(Offset))); in getValueFromICmpCondition()
1111 if (LHS == Val || Offset) { in getValueFromICmpCondition()
1137 getValueFromCondition(Value *Val, Value *Cond, bool isTrueDest,
1141 getValueFromConditionImpl(Value *Val, Value *Cond, bool isTrueDest, in getValueFromConditionImpl() argument
1144 return getValueFromICmpCondition(Val, ICI, isTrueDest); in getValueFromConditionImpl()
1164 return intersect(getValueFromCondition(Val, BL, isTrueDest, Visited), in getValueFromConditionImpl()
1165 getValueFromCondition(Val, BR, isTrueDest, Visited)); in getValueFromConditionImpl()
1169 getValueFromCondition(Value *Val, Value *Cond, bool isTrueDest, in getValueFromCondition() argument
1175 auto Result = getValueFromConditionImpl(Val, Cond, isTrueDest, Visited); in getValueFromCondition()
1180 ValueLatticeElement getValueFromCondition(Value *Val, Value *Cond, in getValueFromCondition() argument
1184 return getValueFromCondition(Val, Cond, isTrueDest, Visited); in getValueFromCondition()
1235 static bool getEdgeValueLocal(Value *Val, BasicBlock *BBFrom, in getEdgeValueLocal() argument
1251 if (Condition == Val) { in getEdgeValueLocal()
1253 Type::getInt1Ty(Val->getContext()), isTrueDest)); in getEdgeValueLocal()
1259 Result = getValueFromCondition(Val, Condition, isTrueDest); in getEdgeValueLocal()
1263 if (User *Usr = dyn_cast<User>(Val)) { in getEdgeValueLocal()
1309 if (!isa<IntegerType>(Val->getType())) in getEdgeValueLocal()
1312 if (Condition != Val) { in getEdgeValueLocal()
1314 if (User *Usr = dyn_cast<User>(Val)) in getEdgeValueLocal()
1320 assert((Condition == Val || ValUsesConditionAndMayBeFoldable) && in getEdgeValueLocal()
1324 unsigned BitWidth = Val->getType()->getIntegerBitWidth(); in getEdgeValueLocal()
1331 User *Usr = cast<User>(Val); in getEdgeValueLocal()
1346 if (Case.getCaseSuccessor() != BBTo && Condition == Val) in getEdgeValueLocal()
1359 bool LazyValueInfoImpl::getEdgeValue(Value *Val, BasicBlock *BBFrom, in getEdgeValue() argument
1364 if (Constant *VC = dyn_cast<Constant>(Val)) { in getEdgeValue()
1370 if (!getEdgeValueLocal(Val, BBFrom, BBTo, LocalResult)) in getEdgeValue()
1381 if (!hasBlockValue(Val, BBFrom)) { in getEdgeValue()
1382 if (pushBlockValue(std::make_pair(BBFrom, Val))) in getEdgeValue()
1390 ValueLatticeElement InBlock = getBlockValue(Val, BBFrom); in getEdgeValue()
1391 intersectAssumeOrGuardBlockValueConstantRange(Val, InBlock, in getEdgeValue()
1401 intersectAssumeOrGuardBlockValueConstantRange(Val, InBlock, CxtI); in getEdgeValue()
1628 getPredicateResult(unsigned Pred, Constant *C, const ValueLatticeElement &Val, in getPredicateResult() argument
1632 if (Val.isConstant()) { in getPredicateResult()
1633 Res = ConstantFoldCompareInstOperands(Pred, Val.getConstant(), C, DL, TLI); in getPredicateResult()
1639 if (Val.isConstantRange()) { in getPredicateResult()
1643 const ConstantRange &CR = Val.getConstantRange(); in getPredicateResult()
1668 if (Val.isNotConstant()) { in getPredicateResult()
1674 Val.getNotConstant(), C, DL, in getPredicateResult()
1681 Val.getNotConstant(), C, DL, in getPredicateResult()