LLVM: lib/Analysis/LazyValueInfo.cpp File Reference (original) (raw)
Go to the source code of this file.
| Namespaces | |
|---|---|
| namespace | llvm |
| This is an optimization pass for GlobalISel generic memory operations. |
| Macros | |
|---|---|
| #define | DEBUG_TYPE "lazy-value-info" |
| Functions | |
|---|---|
| INITIALIZE_PASS_BEGIN (LazyValueInfoWrapperPass, "lazy-value-info", "Lazy Value Information Analysis", false, true) INITIALIZE_PASS_END(LazyValueInfoWrapperPass | |
| lazy value Lazy Value Information static true cl::opt< bool > | PerPredRanges ("lvi-per-pred-ranges", cl::Hidden, cl::init(false), cl::desc("Enable tracking of ranges for a value in a block for" "each block predecessor (default = false)")) |
| LLVM_ABI FunctionPass * | llvm::createLazyValueInfoPass () |
| createLazyValueInfoPass - This creates an instance of the LazyValueInfo pass. | |
| static bool | hasSingleValue (const ValueLatticeElement &Val) |
| Returns true if this lattice value represents at most one possible value. | |
| static ValueLatticeElement | getFromRangeMetadata (Instruction *BBI) |
| static void | AddNonNullPointer (Value *Ptr, NonNullPointerSet &PtrSet, bool IsDereferenced=true) |
| static void | AddNonNullPointersByInstruction (Instruction *I, NonNullPointerSet &PtrSet) |
| static bool | matchICmpOperand (APInt &Offset, Value *LHS, Value *Val, ICmpInst::Predicate Pred) |
| static std::optional< ConstantRange > | getRangeViaSLT (CmpInst::Predicate Pred, APInt RHS, function_ref< std::optional< ConstantRange >(const APInt &)> Fn) |
| static ValueLatticeElement | getValueFromICmpCtpop (ICmpInst::Predicate Pred, Value *RHS) |
| Get value range for a "ctpop(Val) Pred RHS" condition. | |
| static ValueLatticeElement | getValueFromOverflowCondition (Value *Val, WithOverflowInst *WO, bool IsTrueDest) |
| static bool | usesOperand (User *Usr, Value *Op) |
| static bool | isOperationFoldable (User *Usr) |
| static ValueLatticeElement | constantFoldUser (User *Usr, Value *Op, const APInt &OpConstVal, const DataLayout &DL) |
| static bool | isKnownNonConstant (Value *V) |
| Returns true if we can statically tell that this value will never be a "useful" constant. | |
| static Constant * | getPredicateResult (CmpInst::Predicate Pred, Constant *C, const ValueLatticeElement &Val, const DataLayout &DL) |
◆ DEBUG_TYPE
#define DEBUG_TYPE "lazy-value-info"
◆ AddNonNullPointer()
| void AddNonNullPointer ( Value * Ptr, NonNullPointerSet & PtrSet, bool IsDereferenced = true ) | static |
|---|
◆ AddNonNullPointersByInstruction()
| void AddNonNullPointersByInstruction ( Instruction * I, NonNullPointerSet & PtrSet ) | static |
|---|
◆ constantFoldUser()
Definition at line 1548 of file LazyValueInfo.cpp.
References assert(), llvm::CallingConv::C, llvm::cast(), DL, llvm::dyn_cast(), llvm::dyn_cast_or_null(), llvm::CastInst::getDestTy(), llvm::Constant::getIntegerValue(), llvm::BinaryOperator::getOpcode(), llvm::CastInst::getOpcode(), llvm::User::getOperand(), llvm::ValueLatticeElement::getOverdefined(), llvm::ValueLatticeElement::getRange(), llvm::isa(), isOperationFoldable(), LHS, RHS, llvm::simplifyBinOp(), and llvm::simplifyCastInst().
◆ getFromRangeMetadata()
◆ getPredicateResult()
Definition at line 2023 of file LazyValueInfo.cpp.
References llvm::CallingConv::C, llvm::ConstantFoldCompareInstOperands(), DL, llvm::ValueLatticeElement::getConstant(), llvm::ValueLatticeElement::getConstantRange(), llvm::ConstantInt::getFalse(), llvm::CmpInst::getInversePredicate(), llvm::ValueLatticeElement::getNotConstant(), llvm::ConstantInt::getTrue(), llvm::ConstantRange::icmp(), llvm::CmpInst::ICMP_EQ, llvm::CmpInst::ICMP_NE, llvm::ValueLatticeElement::isConstant(), llvm::ValueLatticeElement::isConstantRange(), llvm::ValueLatticeElement::isNotConstant(), llvm::Constant::isNullValue(), llvm::CmpInst::makeCmpResultType(), and RHS.
Referenced by llvm::LazyValueInfo::getPredicateAt(), and llvm::LazyValueInfo::getPredicateOnEdge().
◆ getRangeViaSLT()
◆ getValueFromICmpCtpop()
Get value range for a "ctpop(Val) Pred RHS" condition.
Definition at line 1313 of file LazyValueInfo.cpp.
References llvm::BitWidth, llvm::dyn_cast(), llvm::APInt::getHighBitsSet(), llvm::APInt::getLimitedValue(), llvm::APInt::getLowBitsSet(), llvm::ConstantRange::getNonEmpty(), llvm::ValueLatticeElement::getOverdefined(), llvm::ValueLatticeElement::getRange(), llvm::ConstantRange::getUnsignedMax(), llvm::ConstantRange::getUnsignedMin(), llvm::ConstantRange::makeExactICmpRegion(), and RHS.
◆ getValueFromOverflowCondition()
Definition at line 1459 of file LazyValueInfo.cpp.
References llvm::CallingConv::C, llvm::BinaryOpIntrinsic::getBinaryOp(), llvm::BinaryOpIntrinsic::getLHS(), llvm::BinaryOpIntrinsic::getNoWrapKind(), llvm::ValueLatticeElement::getOverdefined(), llvm::ValueLatticeElement::getRange(), llvm::BinaryOpIntrinsic::getRHS(), llvm::ConstantRange::inverse(), llvm::PatternMatch::m_APInt(), llvm::ConstantRange::makeExactNoWrapRegion(), and llvm::PatternMatch::match().
◆ hasSingleValue()
◆ INITIALIZE_PASS_BEGIN()
◆ isKnownNonConstant()
Returns true if we can statically tell that this value will never be a "useful" constant.
In practice, this means we've got something like an alloca or a malloc call for which a comparison against a constant can only be guarding dead code. Note that we are potentially giving up some precision in dead code (a constant result) in favour of avoiding a expensive search for a easily answered common query.
Definition at line 1950 of file LazyValueInfo.cpp.
References llvm::isa().
Referenced by llvm::LazyValueInfo::getConstant().
◆ isOperationFoldable()
| bool isOperationFoldable ( User * Usr) | static |
|---|
◆ matchICmpOperand()
| bool matchICmpOperand ( APInt & Offset, Value * LHS, Value * Val, ICmpInst::Predicate Pred ) | static |
|---|
Definition at line 1235 of file LazyValueInfo.cpp.
References llvm::CallingConv::C, llvm::CmpInst::ICMP_UGE, llvm::CmpInst::ICMP_UGT, llvm::CmpInst::ICMP_ULE, llvm::CmpInst::ICMP_ULT, LHS, llvm::PatternMatch::m_AddLike(), llvm::PatternMatch::m_APInt(), llvm::PatternMatch::m_c_And(), llvm::PatternMatch::m_c_Or(), llvm::PatternMatch::m_Specific(), llvm::PatternMatch::m_Value(), llvm::PatternMatch::match(), and llvm::Offset.
◆ PerPredRanges()
| lazy value Lazy Value Information static true cl::opt< bool > PerPredRanges ( "lvi-per-pred-ranges" , cl::Hidden , cl::init(false) , cl::desc("Enable tracking of ranges for a value in a block for" "each block predecessor (default = false)") ) | static |
|---|
References PerPredRanges().
Referenced by PerPredRanges().
◆ usesOperand()
◆ false
◆ info
Definition at line 59 of file LazyValueInfo.cpp.
Referenced by ARM64EmitRuntimeFunction(), ARM64EmitUnwindInfo(), ARM64EmitUnwindInfoForSegment(), ARM64FindSegmentsInFunction(), ARM64ProcessEpilogs(), ARMEmitRuntimeFunction(), ARMEmitUnwindInfo(), checkARM64PackedEpilog(), checkARMPackedEpilog(), EmitRuntimeFunction(), EmitUnwindInfo(), llvm::Win64EH::ARM64UnwindEmitter::EmitUnwindInfo(), llvm::Win64EH::ARMUnwindEmitter::EmitUnwindInfo(), llvm::Win64EH::UnwindEmitter::EmitUnwindInfo(), findLiveReferences(), FindMatchingEpilog(), llvm::CCState::getInRegsParamInfo(), llvm::TargetLowering::getMultipleConstraintMatchWeight(), llvm::ARMTargetLowering::getSingleConstraintMatchWeight(), llvm::AVRTargetLowering::getSingleConstraintMatchWeight(), llvm::PPCTargetLowering::getSingleConstraintMatchWeight(), llvm::SparcTargetLowering::getSingleConstraintMatchWeight(), llvm::TargetLowering::getSingleConstraintMatchWeight(), insertParsePoints(), llvm::opt::Option::Option(), recomputeLiveInValues(), llvm::MachO::swapStruct(), tryARM64PackedUnwind(), and tryARMPackedUnwind().