|
LLVM 24.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 568 of file SCCPSolver.cpp.
|
inline |
Definition at line 930 of file SCCPSolver.cpp.
Referenced by InstVisitor< SCCPInstVisitor >.
|
inline |
Definition at line 961 of file SCCPSolver.cpp.
References F.
|
inline |
Definition at line 894 of file SCCPSolver.cpp.
References F.
|
inline |
Definition at line 953 of file SCCPSolver.cpp.
References F.
|
inline |
Definition at line 943 of file SCCPSolver.cpp.
References llvm::dyn_cast(), and F.
|
inline |
Definition at line 1042 of file SCCPSolver.cpp.
References A(), llvm::ValueLatticeElement::getNot(), llvm::Constant::getNullValue(), llvm::ValueLatticeElement::getOverdefined(), llvm::ValueLatticeElement::getRange(), and Range.
Referenced by trackValueOfArgument().
|
inline |
Definition at line 969 of file SCCPSolver.cpp.
| Constant * SCCPInstVisitor::getConstant | ( | const ValueLatticeElement & | LV, |
| Type * | Ty ) const |
Definition at line 1203 of file SCCPSolver.cpp.
References assert(), C(), llvm::ValueLatticeElement::getConstant(), llvm::ValueLatticeElement::getConstantRange(), llvm::ConstantRange::getSingleElement(), llvm::ValueLatticeElement::isConstant(), and llvm::ValueLatticeElement::isConstantRange().
Referenced by getConstantOrNull().
Definition at line 1219 of file SCCPSolver.cpp.
References llvm::any_of(), assert(), llvm::cast(), llvm::ConstantStruct::get(), llvm::UndefValue::get(), getConstant(), getLatticeValueFor(), getStructLatticeValueFor(), I, llvm::SCCPSolver::isConstant(), and llvm::SCCPSolver::isOverdefined().
|
inline |
Definition at line 892 of file SCCPSolver.cpp.
|
inline |
Definition at line 1012 of file SCCPSolver.cpp.
Referenced by getConstantOrNull().
|
inline |
Definition at line 1030 of file SCCPSolver.cpp.
|
inline |
Definition at line 923 of file SCCPSolver.cpp.
References I.
|
inline |
Definition at line 985 of file SCCPSolver.cpp.
References assert(), llvm::dyn_cast(), and I.
Referenced by getConstantOrNull().
|
inline |
Definition at line 1026 of file SCCPSolver.cpp.
|
inline |
Definition at line 1021 of file SCCPSolver.cpp.
Definition at line 965 of file SCCPSolver.cpp.
References F.
|
inline |
Definition at line 979 of file SCCPSolver.cpp.
| bool SCCPInstVisitor::isEdgeFeasible | ( | BasicBlock * | From, |
| BasicBlock * | To ) const |
Definition at line 1426 of file SCCPSolver.cpp.
| bool SCCPInstVisitor::isStructLatticeConstant | ( | Function * | F, |
| StructType * | STy ) |
Definition at line 1193 of file SCCPSolver.cpp.
References assert(), F, llvm::StructType::getNumElements(), and llvm::SCCPSolver::isReplaceableConstant().
| bool SCCPInstVisitor::markBlockExecutable | ( | BasicBlock * | BB | ) |
Definition at line 1108 of file SCCPSolver.cpp.
References llvm::dbgs(), llvm::Value::getName(), and LLVM_DEBUG.
|
inline |
Definition at line 1068 of file SCCPSolver.cpp.
References F.
|
inline |
Definition at line 1034 of file SCCPSolver.cpp.
References llvm::dyn_cast().
Definition at line 957 of file SCCPSolver.cpp.
References F.
|
inline |
Definition at line 997 of file SCCPSolver.cpp.
|
inline |
Definition at line 899 of file SCCPSolver.cpp.
References llvm::dyn_cast(), F, and llvm::make_early_inc_range().
|
inline |
| bool SCCPInstVisitor::resolvedUndef | ( | Instruction & | I | ) |
Definition at line 2288 of file SCCPSolver.cpp.
References llvm::dyn_cast(), F, llvm::CallBase::getCalledFunction(), I, llvm::isa(), 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 2356 of file SCCPSolver.cpp.
References llvm::dbgs(), F, I, LLVM_DEBUG, and resolvedUndef().
Referenced by solveWhileResolvedUndefsIn(), and solveWhileResolvedUndefsIn().
| void SCCPInstVisitor::setLatticeValueForSpecializationArguments | ( | Function * | F, |
| const SmallVectorImpl< ArgInfo > & | Args ) |
Definition at line 1245 of file SCCPSolver.cpp.
References assert(), llvm::dbgs(), llvm::dyn_cast(), llvm::End, F, llvm::Value::getNameOrAsOperand(), llvm::Value::getType(), I, LLVM_DEBUG, and llvm::ValueLatticeElement::markConstant().
| void SCCPInstVisitor::solve | ( | ) |
Definition at line 2260 of file SCCPSolver.cpp.
References llvm::dbgs(), I, LLVM_DEBUG, and llvm::InstVisitor< SCCPInstVisitor >::visit().
Referenced by solveWhileResolvedUndefs(), solveWhileResolvedUndefsIn(), and solveWhileResolvedUndefsIn().
|
inline |
Definition at line 1093 of file SCCPSolver.cpp.
References llvm::dyn_cast(), I, resolvedUndef(), and solve().
|
inline |
Definition at line 1073 of file SCCPSolver.cpp.
References F, resolvedUndefsIn(), and solve().
|
inline |
Definition at line 1083 of file SCCPSolver.cpp.
References F, resolvedUndefsIn(), and solve().
|
inline |
Definition at line 1053 of file SCCPSolver.cpp.
References A(), and getArgAttributeVL().
|
inline |
Definition at line 935 of file SCCPSolver.cpp.
References llvm::GlobalVariable::getInitializer(), llvm::GlobalValue::getValueType(), llvm::Type::isSingleValueType(), and IV.
|
inline |
Definition at line 919 of file SCCPSolver.cpp.
References I.
|
friend |
Definition at line 835 of file SCCPSolver.cpp.
References I, and SCCPInstVisitor().