LLVM 17.0.0git
|
Helper class for SCCPSolver. More...
Friends | |
class | InstVisitor< SCCPInstVisitor > |
Helper class for SCCPSolver.
This implements the instruction visitor and holds all the state.
Definition at line 328 of file SCCPSolver.cpp.
|
inline |
Definition at line 680 of file SCCPSolver.cpp.
|
inline |
Definition at line 712 of file SCCPSolver.cpp.
References F, and llvm::SmallPtrSetImpl< PtrType >::insert().
Definition at line 654 of file SCCPSolver.cpp.
References F, and llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::insert().
|
inline |
Definition at line 658 of file SCCPSolver.cpp.
References F, and llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::insert().
|
inline |
Definition at line 704 of file SCCPSolver.cpp.
References F, and llvm::SmallPtrSetImpl< PtrType >::insert().
|
inline |
Definition at line 693 of file SCCPSolver.cpp.
References F, llvm::MapVector< KeyT, ValueT, MapType, VectorType >::insert(), and llvm::SmallPtrSetImpl< PtrType >::insert().
|
inline |
Definition at line 795 of file SCCPSolver.cpp.
Constant * SCCPInstVisitor::getConstant | ( | const ValueLatticeElement & | LV | ) | const |
Definition at line 894 of file SCCPSolver.cpp.
References llvm::ConstantInt::get(), llvm::ValueLatticeElement::getConstant(), llvm::ValueLatticeElement::getConstantRange(), llvm::ValueLatticeElement::isConstant(), and llvm::ValueLatticeElement::isConstantRange().
Referenced by getConstantOrNull().
Definition at line 906 of file SCCPSolver.cpp.
References llvm::any_of(), assert(), E, llvm::ConstantStruct::get(), llvm::UndefValue::get(), getConstant(), getLatticeValueFor(), getStructLatticeValueFor(), I, llvm::SCCPSolver::isConstant(), and llvm::SCCPSolver::isOverdefined().
|
inline |
Definition at line 759 of file SCCPSolver.cpp.
References assert(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::end(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::find(), and I.
Referenced by getConstantOrNull().
Definition at line 673 of file SCCPSolver.cpp.
References assert(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::end(), F, and llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::find().
|
inline |
Definition at line 777 of file SCCPSolver.cpp.
|
inline |
Definition at line 666 of file SCCPSolver.cpp.
References llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::end(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::find(), and I.
|
inline |
Definition at line 732 of file SCCPSolver.cpp.
References assert(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::end(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::find(), and I.
Referenced by getConstantOrNull().
|
inline |
Definition at line 773 of file SCCPSolver.cpp.
|
inline |
Definition at line 769 of file SCCPSolver.cpp.
Definition at line 716 of file SCCPSolver.cpp.
References llvm::SmallPtrSetImpl< PtrType >::count(), and F.
|
inline |
Definition at line 726 of file SCCPSolver.cpp.
bool SCCPInstVisitor::isEdgeFeasible | ( | BasicBlock * | From, |
BasicBlock * | To | ||
) | const |
Definition at line 1114 of file SCCPSolver.cpp.
References llvm::detail::DenseSetImpl< ValueT, MapTy, ValueInfoT >::count(), and From.
bool SCCPInstVisitor::isStructLatticeConstant | ( | Function * | F, |
StructType * | STy | ||
) |
Definition at line 883 of file SCCPSolver.cpp.
References assert(), F, llvm::StructType::getNumElements(), and llvm::SCCPSolver::isConstant().
bool SCCPInstVisitor::markBlockExecutable | ( | BasicBlock * | BB | ) |
Definition at line 842 of file SCCPSolver.cpp.
References llvm::dbgs(), llvm::Value::getName(), and LLVM_DEBUG.
|
inline |
Definition at line 802 of file SCCPSolver.cpp.
References F.
|
inline |
Definition at line 781 of file SCCPSolver.cpp.
Definition at line 708 of file SCCPSolver.cpp.
References llvm::SmallPtrSetImpl< PtrType >::count(), and F.
|
inline |
Definition at line 744 of file SCCPSolver.cpp.
References llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::erase().
|
inline |
Invalidate the Lattice Value of Call
and its users after specializing the call.
Then recompute it.
Definition at line 748 of file SCCPSolver.cpp.
References assert(), llvm::MapVector< KeyT, ValueT, MapType, VectorType >::count(), llvm::SmallPtrSetImpl< PtrType >::count(), and F.
bool SCCPInstVisitor::resolvedUndef | ( | Instruction & | I | ) |
Definition at line 1857 of file SCCPSolver.cpp.
References F, llvm::CallBase::getCalledFunction(), I, and llvm::ValueLatticeElement::isUnknown().
Referenced by resolvedUndefsIn(), and solveWhileResolvedUndefs().
While solving the dataflow for a function, we don't compute a result for operations with an undef operand, to allow undef to be lowered to a constant later.
For example, constant folding of "zext i8 undef to i16" would result in "i16 0", and if undef is later lowered to "i8 1", then the zext result would become "i16 1" and would result into an overdefined lattice value once merged with the previous result. Not computing the result of the zext (treating undef the same as unknown) allows us to handle a later undef->constant lowering more optimally.
However, if the operand remains undef when the solver returns, we do need to assign some result to the instruction (otherwise we would treat it as unreachable). For simplicity, we mark any instructions that are still unknown as overdefined.
Definition at line 1925 of file SCCPSolver.cpp.
References llvm::dbgs(), F, I, LLVM_DEBUG, and resolvedUndef().
Referenced by solveWhileResolvedUndefsIn().
void SCCPInstVisitor::setLatticeValueForSpecializationArguments | ( | Function * | F, |
const SmallVectorImpl< ArgInfo > & | Args | ||
) |
Definition at line 932 of file SCCPSolver.cpp.
References assert(), llvm::dbgs(), E, End, F, llvm::Value::getNameOrAsOperand(), llvm::Value::getType(), I, LLVM_DEBUG, and llvm::ValueLatticeElement::markConstant().
void SCCPInstVisitor::solve | ( | ) |
Definition at line 1804 of file SCCPSolver.cpp.
References llvm::dbgs(), llvm::detail::DenseSetImpl< ValueT, MapTy, ValueInfoT >::erase(), I, LLVM_DEBUG, and llvm::InstVisitor< SCCPInstVisitor >::visit().
Referenced by solveWhileResolvedUndefs(), and solveWhileResolvedUndefsIn().
|
inline |
Definition at line 827 of file SCCPSolver.cpp.
References llvm::detail::DenseSetImpl< ValueT, MapTy, ValueInfoT >::clear(), I, resolvedUndef(), and solve().
|
inline |
Definition at line 807 of file SCCPSolver.cpp.
References F, resolvedUndefsIn(), and solve().
|
inline |
Definition at line 817 of file SCCPSolver.cpp.
References F, resolvedUndefsIn(), and solve().
|
inline |
Definition at line 685 of file SCCPSolver.cpp.
References llvm::GlobalVariable::getInitializer(), llvm::GlobalValue::getValueType(), llvm::Type::isSingleValueType(), and IV.
|
inline |
Definition at line 662 of file SCCPSolver.cpp.
References I.
|
friend |
Definition at line 598 of file SCCPSolver.cpp.