LLVM 20.0.0git
|
#include "llvm/Support/InstructionCost.h"
Public Types | |
enum | CostState { Valid , Invalid } |
CostState describes the state of a cost. More... | |
using | CostType = int64_t |
Static Public Member Functions | |
static InstructionCost | getMax () |
static InstructionCost | getMin () |
static InstructionCost | getInvalid (CostType Val=0) |
Definition at line 29 of file InstructionCost.h.
using llvm::InstructionCost::CostType = int64_t |
Definition at line 31 of file InstructionCost.h.
CostState describes the state of a cost.
Definition at line 34 of file InstructionCost.h.
|
default |
|
delete |
|
inline |
Definition at line 69 of file InstructionCost.h.
|
inlinestatic |
Definition at line 73 of file InstructionCost.h.
References setInvalid().
Referenced by llvm::ComputeSpeculationCost(), llvm::VPRegionBlock::cost(), llvm::TargetTransformInfoImplBase::getAltInstrCost(), llvm::X86TTIImpl::getAltInstrCost(), llvm::AArch64TTIImpl::getArithmeticInstrCost(), llvm::AArch64TTIImpl::getArithmeticReductionCost(), llvm::AArch64TTIImpl::getArithmeticReductionCostSVE(), llvm::BasicTTIImplBase< T >::getCastInstrCost(), llvm::BasicTTIImplBase< T >::getCmpSelInstrCost(), llvm::LoopVectorizationCostModel::getDivRemSpeculationCost(), llvm::AArch64TTIImpl::getGatherScatterOpCost(), getHistogramCost(), llvm::LoopVectorizationCostModel::getInstructionCost(), llvm::BasicTTIImplBase< T >::getInterleavedMemoryOpCost(), llvm::AArch64TTIImpl::getInterleavedMemoryOpCost(), llvm::RISCVTTIImpl::getInterleavedMemoryOpCost(), llvm::BasicTTIImplBase< T >::getIntrinsicInstrCost(), llvm::AArch64TTIImpl::getIntrinsicInstrCost(), llvm::TargetTransformInfoImplBase::getIntrinsicInstrCost(), llvm::RISCVTargetLowering::getLMULCost(), llvm::AArch64TTIImpl::getMaskedMemoryOpCost(), llvm::AArch64TTIImpl::getMemoryOpCost(), llvm::BasicTTIImplBase< T >::getMinMaxReductionCost(), llvm::AArch64TTIImpl::getMinMaxReductionCost(), llvm::BasicTTIImplBase< T >::getOrderedReductionCost(), llvm::BasicTTIImplBase< T >::getScalarizationOverhead(), llvm::AArch64TTIImpl::getScalarizationOverhead(), llvm::BasicTTIImplBase< T >::getShuffleCost(), llvm::AArch64TTIImpl::getSpliceCost(), llvm::TargetTransformInfoImplBase::getStridedMemoryOpCost(), llvm::BasicTTIImplBase< T >::getTreeReductionCost(), llvm::BasicTTIImplBase< T >::getTypeBasedIntrinsicInstrCost(), llvm::BasicTTIImplBase< T >::getTypeLegalizationCost(), map(), llvm::CostModelPrinterPass::run(), llvm::LoopVectorizationCostModel::setCostBasedWideningDecision(), llvm::LoopVectorizationCostModel::setVectorizedCallDecision(), and llvm::PPCTTIImpl::vectorCostAdjustmentFactor().
|
inlinestatic |
Definition at line 71 of file InstructionCost.h.
Referenced by llvm::LoopVectorizationPlanner::computeBestVF(), llvm::HexagonTTIImpl::getArithmeticInstrCost(), llvm::PPCTTIImpl::getArithmeticInstrCost(), llvm::HexagonTTIImpl::getCastInstrCost(), llvm::PPCTTIImpl::getCastInstrCost(), llvm::HexagonTTIImpl::getCmpSelInstrCost(), llvm::PPCTTIImpl::getCmpSelInstrCost(), llvm::PPCTTIImpl::getInterleavedMemoryOpCost(), llvm::PPCTTIImpl::getMemoryOpCost(), llvm::PPCTTIImpl::getShuffleCost(), llvm::PPCTTIImpl::getVectorInstrCost(), and llvm::PPCTTIImpl::getVPMemoryOpCost().
|
inlinestatic |
Definition at line 72 of file InstructionCost.h.
|
inline |
Definition at line 82 of file InstructionCost.h.
|
inline |
This function is intended to be used as sparingly as possible, since the class provides the full range of operator support required for arithmetic and comparisons.
Definition at line 87 of file InstructionCost.h.
References isValid().
Referenced by adjustInliningThresholdUsingCallee(), analyzeLoopUnrollCost(), areRuntimeChecksProfitable(), llvm::BasicTTIImplBase< T >::getInterleavedMemoryOpCost(), llvm::UnrollCostEstimator::getRolledLoopSize(), llvm::X86TTIImpl::getShuffleCost(), llvm::UnrollCostEstimator::getUnrolledLoopSize(), llvm::SystemZTTIImpl::getUnrollingPreferences(), llvm::PPCTTIImpl::getVPMemoryOpCost(), llvm::CostModelPrinterPass::run(), and llvm::LoopVectorizationCostModel::selectInterleaveCount().
|
inline |
Definition at line 79 of file InstructionCost.h.
References Valid.
Referenced by analyzeLoopUnrollCost(), areRuntimeChecksProfitable(), llvm::UnrollCostEstimator::canUnroll(), llvm::VPRecipeBase::cost(), dominatesMergePoint(), llvm::PPCTTIImpl::getArithmeticInstrCost(), llvm::PPCTTIImpl::getCastInstrCost(), llvm::PPCTTIImpl::getCmpSelInstrCost(), llvm::TargetTransformInfo::getGatherScatterOpCost(), llvm::BasicTTIImplBase< T >::getInterleavedMemoryOpCost(), llvm::PPCTTIImpl::getInterleavedMemoryOpCost(), llvm::PPCTTIImpl::getMemoryOpCost(), llvm::LoopVectorizationCostModel::getReductionPatternCost(), getScalingFactorCost(), llvm::PPCTTIImpl::getShuffleCost(), llvm::X86TTIImpl::getShuffleCost(), getValue(), llvm::PPCTTIImpl::getVectorInstrCost(), llvm::PPCTTIImpl::getVPMemoryOpCost(), map(), print(), llvm::LoopVectorizationCostModel::selectInterleaveCount(), llvm::LoopVectorizationCostModel::selectUserVectorizationFactor(), llvm::IntrinsicCostAttributes::skipScalarizationCost(), and llvm::UnrollCostEstimator::UnrollCostEstimator().
|
inline |
Definition at line 245 of file InstructionCost.h.
References F, getInvalid(), and isValid().
Definition at line 214 of file InstructionCost.h.
References RHS.
|
inline |
Definition at line 207 of file InstructionCost.h.
References RHS.
|
inline |
Definition at line 150 of file InstructionCost.h.
References RHS.
|
inline |
Definition at line 134 of file InstructionCost.h.
References llvm::MulOverflow(), and RHS.
|
inline |
Definition at line 168 of file InstructionCost.h.
|
inline |
Definition at line 173 of file InstructionCost.h.
|
inline |
Definition at line 111 of file InstructionCost.h.
References RHS.
|
inline |
For all of the arithmetic operators provided here any invalid state is perpetuated and cannot be removed.
Once a cost becomes invalid it stays invalid, and it also inherits any invalid state from the RHS. Arithmetic work on the actual values is implemented with saturation, to avoid overflow when using more extreme cost values.
Definition at line 99 of file InstructionCost.h.
References llvm::AddOverflow(), and RHS.
|
inline |
Definition at line 179 of file InstructionCost.h.
|
inline |
Definition at line 184 of file InstructionCost.h.
|
inline |
Definition at line 128 of file InstructionCost.h.
References RHS.
|
inline |
Definition at line 117 of file InstructionCost.h.
References RHS, and llvm::SubOverflow().
|
inline |
Definition at line 162 of file InstructionCost.h.
References RHS.
|
inline |
Definition at line 156 of file InstructionCost.h.
References RHS.
Definition at line 222 of file InstructionCost.h.
References RHS.
|
inline |
For the comparison operators we have chosen to use lexicographical ordering where valid costs are always considered to be less than invalid costs.
This avoids having to add asserts to the comparison operators that the states are valid and users can test for validity of the cost explicitly.
Definition at line 195 of file InstructionCost.h.
References RHS.
Definition at line 232 of file InstructionCost.h.
References RHS.
|
inline |
Definition at line 218 of file InstructionCost.h.
References RHS.
Definition at line 209 of file InstructionCost.h.
References RHS.
|
inline |
Definition at line 203 of file InstructionCost.h.
References RHS.
Definition at line 227 of file InstructionCost.h.
References RHS.
|
inline |
Definition at line 216 of file InstructionCost.h.
References RHS.
Definition at line 237 of file InstructionCost.h.
References RHS.
|
inline |
Definition at line 220 of file InstructionCost.h.
References RHS.
void InstructionCost::print | ( | raw_ostream & | OS | ) | const |
Definition at line 19 of file InstructionCost.cpp.
|
inline |
|
inline |
Definition at line 80 of file InstructionCost.h.
References Valid.