|
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/InstSimplifyFolder.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 SmallVector< std::pair< const VPBasicBlock *, BranchProbability >, 2 > | getSuccessorProbabilities (const VPBasicBlock *VPBB) |
Returns the probability of reaching each unique successor of VPBB, taken from the branch weights recorded on its terminator, or unknown if not available. | |
| static BlockFrequency | scaleKeepingNonZero (BlockFrequency Freq, BranchProbability Prob) |
Returns Freq scaled by Prob, rounding up to 1 instead of 0 to keep a rarely executed block distinguishable from an unreachable one. | |
|
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 1165 of file VPlanUtils.cpp.
References llvm::BranchProbability::getBranchProbability(), llvm::BranchProbability::getDenominator(), llvm::BranchProbability::getRaw(), P, and uint64_t.
Referenced by llvm::vputils::getExecutionProbability(), and getSuccessorProbabilities().
|
static |
Returns the probability of reaching each unique successor of VPBB, taken from the branch weights recorded on its terminator, or unknown if not available.
See llvm::getBranchProbability in llvm/Transforms/Utils/LoopUtils.h for the IR version.
Definition at line 1184 of file VPlanUtils.cpp.
References llvm::SmallVectorImpl< T >::assign(), llvm::cast(), llvm::dyn_cast_if_present(), llvm::extractBranchWeights(), getBranchProbabilityKeepingPartial(), llvm::BranchProbability::getOne(), llvm::VPBlockBase::getSingleSuccessor(), llvm::VPBlockBase::getSuccessors(), llvm::VPBasicBlock::getTerminator(), llvm::BranchProbability::getUnknown(), llvm::map_to_vector(), llvm::ArrayRef< T >::size(), llvm::SmallVectorTemplateCommon< T, typename >::size(), llvm::sum_of(), llvm::Total, uint64_t, and llvm::zip_equal().
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 68 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 407 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().
|
static |
Returns Freq scaled by Prob, rounding up to 1 instead of 0 to keep a rarely executed block distinguishable from an unreachable one.
Definition at line 1218 of file VPlanUtils.cpp.
References llvm::BranchProbability::isZero(), and Scaled.
Referenced by llvm::vputils::computeExecutionFrequencies().