|
LLVM 24.0.0git
|
#include "llvm/Analysis/LazyValueInfo.h"#include "AnalysisOptions.h"#include "llvm/ADT/DenseSet.h"#include "llvm/ADT/STLExtras.h"#include "llvm/Analysis/AssumptionCache.h"#include "llvm/Analysis/ConstantFolding.h"#include "llvm/Analysis/InstructionSimplify.h"#include "llvm/Analysis/Passes.h"#include "llvm/Analysis/TargetLibraryInfo.h"#include "llvm/Analysis/ValueLattice.h"#include "llvm/Analysis/ValueTracking.h"#include "llvm/IR/AssemblyAnnotationWriter.h"#include "llvm/IR/BundleAttributes.h"#include "llvm/IR/CFG.h"#include "llvm/IR/ConstantRange.h"#include "llvm/IR/Constants.h"#include "llvm/IR/DataLayout.h"#include "llvm/IR/Dominators.h"#include "llvm/IR/InstrTypes.h"#include "llvm/IR/Instructions.h"#include "llvm/IR/IntrinsicInst.h"#include "llvm/IR/Intrinsics.h"#include "llvm/IR/LLVMContext.h"#include "llvm/IR/Module.h"#include "llvm/IR/PatternMatch.h"#include "llvm/IR/ValueHandle.h"#include "llvm/InitializePasses.h"#include "llvm/Support/Debug.h"#include "llvm/Support/FormattedStream.h"#include "llvm/Support/KnownBits.h"#include "llvm/Support/raw_ostream.h"#include <optional>Go to the source code of this file.
Classes | |
| class | llvm::LazyValueInfoImpl |
Namespaces | |
| namespace | llvm |
| This is an optimization pass for GlobalISel generic memory operations. | |
Macros | |
| #define | DEBUG_TYPE "lazy-value-info" |
Variables | |
| static const unsigned | MaxProcessedPerValue = 500 |
| lazy value | info |
| lazy value Lazy Value Information | Analysis |
| lazy value Lazy Value Information | false |
| #define DEBUG_TYPE "lazy-value-info" |
Definition at line 49 of file LazyValueInfo.cpp.
|
static |
Definition at line 690 of file LazyValueInfo.cpp.
References llvm::Type::getPointerAddressSpace(), llvm::Value::getType(), llvm::getUnderlyingObject(), and llvm::Value::stripInBoundsOffsets().
Referenced by AddNonNullPointersByInstruction().
|
static |
Definition at line 698 of file LazyValueInfo.cpp.
References AddNonNullPointer(), llvm::dyn_cast(), I, and MI.
|
static |
Definition at line 1607 of file LazyValueInfo.cpp.
References assert(), 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().
|
static |
Definition at line 606 of file LazyValueInfo.cpp.
References llvm::cast(), llvm::getConstantRangeFromMetadata(), llvm::Instruction::getMetadata(), llvm::Instruction::getOpcode(), llvm::ValueLatticeElement::getOverdefined(), llvm::getRange(), llvm::ValueLatticeElement::getRange(), llvm::Value::getType(), llvm::isa(), and Range.
Referenced by llvm::LazyValueInfoImpl::getValueAt().
|
static |
Definition at line 2095 of file LazyValueInfo.cpp.
References 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(), Pred, and RHS.
Referenced by llvm::LazyValueInfo::getPredicateAt(), and llvm::LazyValueInfo::getPredicateOnEdge().
|
static |
Get the unsigned range for V from a mul nuw V, V comparison.
Definition at line 1364 of file LazyValueInfo.cpp.
References C(), llvm::CmpInst::getSwappedPredicate(), llvm::ConstantRange::isFullSet(), LHS, llvm::PatternMatch::m_APInt(), llvm::PatternMatch::m_NUWMul(), llvm::PatternMatch::m_Specific(), llvm::ConstantRange::makeExactICmpRegion(), llvm::PatternMatch::match(), Pred, RHS, llvm::ConstantRange::sqrtFloor(), and V.
|
static |
Definition at line 1322 of file LazyValueInfo.cpp.
References assert(), llvm::CmpInst::getInversePredicate(), llvm::CmpInst::ICMP_SGE, llvm::CmpInst::ICMP_SGT, llvm::CmpInst::ICMP_SLE, llvm::CmpInst::ICMP_SLT, Pred, and RHS.
|
static |
Get value range for a "ctpop(Val) Pred RHS" condition.
Definition at line 1342 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(), Pred, and RHS.
|
static |
Definition at line 1518 of file LazyValueInfo.cpp.
References 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().
|
static |
Returns true if this lattice value represents at most one possible value.
This is as precise as any lattice value can get while still representing reachable code.
Definition at line 75 of file LazyValueInfo.cpp.
References llvm::ValueLatticeElement::getConstantRange(), llvm::ValueLatticeElement::isConstant(), llvm::ValueLatticeElement::isConstantRange(), and llvm::ConstantRange::isSingleElement().
| INITIALIZE_PASS_BEGIN | ( | LazyValueInfoWrapperPass | , |
| "lazy-value-info" | , | ||
| "Lazy Value Information Analysis" | , | ||
| false | , | ||
| true | ) |
References INITIALIZE_PASS_DEPENDENCY.
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 2028 of file LazyValueInfo.cpp.
References llvm::isa(), and V.
Referenced by llvm::LazyValueInfo::getConstant().
Definition at line 1599 of file LazyValueInfo.cpp.
References llvm::isa().
Referenced by constantFoldUser().
Definition at line 1264 of file LazyValueInfo.cpp.
References 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(), llvm::Offset, and Pred.
Definition at line 1591 of file LazyValueInfo.cpp.
References llvm::is_contained(), and llvm::User::operands().
| lazy value Lazy Value Information Analysis |
Definition at line 62 of file LazyValueInfo.cpp.
| lazy value Lazy Value Information false |
Definition at line 62 of file LazyValueInfo.cpp.
| lazy value info |
Definition at line 61 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(), llvm::GenericCycleInfo< SSAContext >::getSmallestCommonCycle(), insertParsePoints(), recomputeLiveInValues(), llvm::GenericCycleInfoCompute< ContextT >::run(), llvm::MachO::swapStruct(), tryARM64PackedUnwind(), and tryARMPackedUnwind().
Definition at line 53 of file LazyValueInfo.cpp.