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 349 of file SCCPSolver.cpp.
|
inline |
Definition at line 639 of file SCCPSolver.cpp.
|
inline |
Definition at line 611 of file SCCPSolver.cpp.
References A, F, and llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::insert().
|
inline |
Definition at line 671 of file SCCPSolver.cpp.
References F, and llvm::SmallPtrSetImpl< PtrType >::insert().
|
inline |
Definition at line 663 of file SCCPSolver.cpp.
References F, and llvm::SmallPtrSetImpl< PtrType >::insert().
|
inline |
Definition at line 652 of file SCCPSolver.cpp.
References F, llvm::MapVector< KeyT, ValueT, MapType, VectorType >::insert(), and llvm::SmallPtrSetImpl< PtrType >::insert().
|
inline |
Definition at line 737 of file SCCPSolver.cpp.
Constant * SCCPInstVisitor::getConstant | ( | const ValueLatticeElement & | LV | ) | const |
Definition at line 824 of file SCCPSolver.cpp.
References llvm::ConstantInt::get(), llvm::ValueLatticeElement::getConstant(), llvm::ValueLatticeElement::getConstantRange(), llvm::ValueLatticeElement::isConstant(), and llvm::ValueLatticeElement::isConstantRange().
|
inline |
Definition at line 633 of file SCCPSolver.cpp.
References A, assert(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::end(), F, llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::find(), and llvm::DomTreeUpdater::Lazy.
|
inline |
Definition at line 703 of file SCCPSolver.cpp.
References assert(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::end(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::find(), and I.
Definition at line 626 of file SCCPSolver.cpp.
References A, assert(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::end(), F, and llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::find().
|
inline |
Definition at line 721 of file SCCPSolver.cpp.
|
inline |
Definition at line 619 of file SCCPSolver.cpp.
References A, llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::end(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::find(), and I.
|
inline |
Definition at line 689 of file SCCPSolver.cpp.
References assert(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::end(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::find(), and I.
|
inline |
Definition at line 717 of file SCCPSolver.cpp.
|
inline |
Definition at line 713 of file SCCPSolver.cpp.
Definition at line 675 of file SCCPSolver.cpp.
References llvm::SmallPtrSetImpl< PtrType >::count(), and F.
|
inline |
Definition at line 683 of file SCCPSolver.cpp.
bool SCCPInstVisitor::isEdgeFeasible | ( | BasicBlock * | From, |
BasicBlock * | To | ||
) | const |
Definition at line 1012 of file SCCPSolver.cpp.
References llvm::detail::DenseSetImpl< ValueT, MapTy, ValueInfoT >::count(), and From.
bool SCCPInstVisitor::isStructLatticeConstant | ( | Function * | F, |
StructType * | STy | ||
) |
Definition at line 813 of file SCCPSolver.cpp.
References assert(), F, llvm::StructType::getNumElements(), and llvm::SCCPSolver::isConstant().
void SCCPInstVisitor::markArgInFuncSpecialization | ( | Function * | F, |
const SmallVectorImpl< ArgInfo > & | Args | ||
) |
Definition at line 836 of file SCCPSolver.cpp.
References assert(), llvm::dbgs(), F, llvm::Value::getNameOrAsOperand(), and LLVM_DEBUG.
bool SCCPInstVisitor::markBlockExecutable | ( | BasicBlock * | BB | ) |
Definition at line 772 of file SCCPSolver.cpp.
References llvm::dbgs(), llvm::Value::getName(), and LLVM_DEBUG.
|
inline |
Definition at line 744 of file SCCPSolver.cpp.
References F.
|
inline |
Definition at line 725 of file SCCPSolver.cpp.
Definition at line 667 of file SCCPSolver.cpp.
References llvm::SmallPtrSetImpl< PtrType >::count(), and F.
|
inline |
Definition at line 701 of file SCCPSolver.cpp.
References llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::erase().
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 1766 of file SCCPSolver.cpp.
References llvm::dbgs(), F, llvm::CallBase::getCalledFunction(), I, llvm::ValueLatticeElement::isUnknown(), and LLVM_DEBUG.
Referenced by solveWhileResolvedUndefsIn().
void SCCPInstVisitor::solve | ( | ) |
Definition at line 1702 of file SCCPSolver.cpp.
References llvm::dbgs(), I, LLVM_DEBUG, and llvm::InstVisitor< SCCPInstVisitor >::visit().
Referenced by solveWhileResolvedUndefsIn().
|
inline |
Definition at line 749 of file SCCPSolver.cpp.
References F, resolvedUndefsIn(), and solve().
|
inline |
Definition at line 759 of file SCCPSolver.cpp.
References F, resolvedUndefsIn(), and solve().
|
inline |
Definition at line 644 of file SCCPSolver.cpp.
References llvm::GlobalVariable::getInitializer(), llvm::GlobalValue::getValueType(), llvm::Type::isSingleValueType(), and IV.
|
inline |
Definition at line 615 of file SCCPSolver.cpp.
References I.
|
friend |
Definition at line 555 of file SCCPSolver.cpp.