|
LLVM 24.0.0git
|
#include "VPlanUtils.h"#include "LoopVectorizationPlanner.h"#include "VPlanAnalysis.h"#include "VPlanCFG.h"#include "VPlanDominatorTree.h"#include "VPlanPatternMatch.h"#include "llvm/ADT/MapVector.h"#include "llvm/ADT/SetVector.h"#include "llvm/ADT/SmallVectorExtras.h"#include "llvm/ADT/TypeSwitch.h"#include "llvm/Analysis/BlockFrequencyInfoImpl.h"#include "llvm/Analysis/BranchProbabilityInfo.h"#include "llvm/Analysis/InstSimplifyFolder.h"#include "llvm/Analysis/LoopAccessAnalysis.h"#include "llvm/Analysis/LoopInfo.h"#include "llvm/Analysis/MemoryLocation.h"#include "llvm/Analysis/ScalarEvolutionExpressions.h"#include "llvm/Analysis/ScalarEvolutionPatternMatch.h"#include "llvm/IR/Dominators.h"#include "llvm/IR/ProfDataUtils.h"#include "llvm/Transforms/Utils/ScalarEvolutionExpander.h"Go to the source code of this file.
Functions | |
| static bool | poisonGuaranteesUB (const VPValue *V) |
Returns true if V being poison is guaranteed to trigger UB because it propagates to the address of a memory recipe. | |
| static bool | preservesUniformity (unsigned Opcode) |
Returns true if Opcode preserves uniformity, i.e., if all operands are uniform, the result will also be uniform. | |
| static BranchProbability | getBranchProbabilityKeepingPartial (uint64_t Num, uint64_t Denom) |
Returns Num / Denom as a BranchProbability, clamped so a ratio that is neither zero nor one does not round to zero or one. | |
| static std::optional< SmallVector< BranchProbability > > | getSuccessorProbabilities (const VPBasicBlock *VPBB) |
Returns the probability of each successor edge of VPBB, computed via BranchProbabilityInfo::getEdgeProbabilitiesFromWeights from the branch weights recorded on its terminator, or std::nullopt if not available. | |
|
static |
Returns Num / Denom as a BranchProbability, clamped so a ratio that is neither zero nor one does not round to zero or one.
BlockFrequencyInfo also keeps a zero-weight edge distinguishable from an unreachable one.
Definition at line 1205 of file VPlanUtils.cpp.
References llvm::BranchProbability::getBranchProbability(), llvm::BranchProbability::getDenominator(), llvm::BranchProbability::getRaw(), P, and uint64_t.
Referenced by llvm::vputils::getExecutionProbability().
|
static |
Returns the probability of each successor edge of VPBB, computed via BranchProbabilityInfo::getEdgeProbabilitiesFromWeights from the branch weights recorded on its terminator, or std::nullopt if not available.
Definition at line 1224 of file VPlanUtils.cpp.
References llvm::dyn_cast_if_present(), llvm::extractBranchWeights(), llvm::BranchProbabilityInfo::getEdgeProbabilitiesFromWeights(), llvm::VPBlockBase::getNumSuccessors(), llvm::BranchProbability::getOne(), llvm::VPBlockBase::getSingleSuccessor(), llvm::VPBasicBlock::getTerminator(), and llvm::SmallVectorTemplateCommon< T, typename >::size().
Referenced by llvm::vputils::computeExecutionFrequencies().
Returns true if V being poison is guaranteed to trigger UB because it propagates to the address of a memory recipe.
Definition at line 71 of file VPlanUtils.cpp.
References llvm::cast(), llvm::dyn_cast(), llvm::SmallVectorTemplateCommon< T, typename >::empty(), llvm::vputils::getOpcode(), llvm::SmallPtrSetImpl< PtrType >::insert(), llvm::isa(), llvm::Instruction::isCast(), llvm::SmallVectorImpl< T >::pop_back_val(), llvm::SmallVectorTemplateBase< T, bool >::push_back(), and llvm::VPValue::users().
Referenced by llvm::vputils::getSCEVExprForVPValue().
Returns true if Opcode preserves uniformity, i.e., if all operands are uniform, the result will also be uniform.
Definition at line 424 of file VPlanUtils.cpp.
References llvm::VPInstruction::Broadcast, llvm::Instruction::isBinaryOp(), llvm::Instruction::isCast(), llvm::VPInstruction::MaskedCond, llvm::VPInstruction::Not, and llvm::VPInstruction::PtrAdd.
Referenced by llvm::vputils::isSingleScalar(), and llvm::vputils::isUniformAcrossVFsAndUFs().