|
LLVM 24.0.0git
|
#include "llvm/Analysis/BlockFrequencyInfoImpl.h"#include "AnalysisOptions.h"#include "llvm/ADT/MapVector.h"#include "llvm/ADT/SCCIterator.h"#include "llvm/ADT/SmallString.h"#include "llvm/Config/llvm-config.h"#include "llvm/IR/Function.h"#include "llvm/Support/BlockFrequency.h"#include "llvm/Support/BranchProbability.h"#include "llvm/Support/Compiler.h"#include "llvm/Support/Debug.h"#include "llvm/Support/MathExtras.h"#include "llvm/Support/ScaledNumber.h"#include "llvm/Support/raw_ostream.h"#include <algorithm>#include <cassert>#include <cstddef>#include <cstdint>#include <iterator>#include <list>#include <numeric>#include <optional>#include <utility>#include <vector>Go to the source code of this file.
Classes | |
| struct | llvm::GraphTraits< IrreducibleGraph > |
Namespaces | |
| namespace | llvm |
| This is an optimization pass for GlobalISel generic memory operations. | |
Macros | |
| #define | DEBUG_TYPE "block-freq" |
Functions | |
| cl::opt< bool > | llvm::UseIterativeBFIInference ("use-iterative-bfi-inference", cl::Hidden, cl::desc("Apply an iterative post-processing to infer correct BFI counts")) |
| static char | getHexDigit (int N) |
| static void | combineWeight (Weight &W, const Weight &OtherW) |
| static void | combineWeightsBySorting (WeightList &Weights) |
| static void | combineWeightsByHashing (WeightList &Weights) |
| static void | combineWeights (WeightList &Weights) |
| static uint64_t | shiftRightAndRound (uint64_t N, int Shift) |
| static void | cleanup (BlockFrequencyInfoImplBase &BFI) |
| Clear all memory not needed downstream. | |
| static void | debugAssign (const BlockFrequencyInfoImplBase &BFI, const DitheringDistributer &D, const BlockNode &T, const BlockMass &M, const char *Desc) |
| static void | convertFloatingToInteger (BlockFrequencyInfoImplBase &BFI) |
| static void | unwrapLoop (BlockFrequencyInfoImplBase &BFI, LoopData &Loop) |
| Unwrap a loop package. | |
| static void | createIrreducibleLoop (BlockFrequencyInfoImplBase &BFI, const IrreducibleGraph &G, LoopData *OuterLoop, std::list< LoopData >::iterator Insert, ArrayRef< const IrreducibleGraph::IrrNode * > SCC, const BitVector &IsEntry, const BitVector &Extra) |
Package SCC into a loop represented by its lowest-RPO member. | |
| #define DEBUG_TYPE "block-freq" |
Definition at line 41 of file BlockFrequencyInfoImpl.cpp.
|
static |
Clear all memory not needed downstream.
Releases all memory not used downstream. In particular, saves Freqs.
Definition at line 296 of file BlockFrequencyInfoImpl.cpp.
References llvm::BlockFrequencyInfoImplBase::clear(), llvm::BlockFrequencyInfoImplBase::Freqs, and llvm::BlockFrequencyInfoImplBase::IsIrrLoopHeader.
Referenced by llvm::BlockFrequencyInfoImplBase::finalizeMetrics(), llvm::CrashRecoveryContext::registerCleanup(), llvm::ConstantHoistingPass::runImpl(), and llvm::CrashRecoveryContext::unregisterCleanup().
|
static |
Definition at line 156 of file BlockFrequencyInfoImpl.cpp.
References assert(), and UINT64_MAX.
Referenced by combineWeightsByHashing(), and combineWeightsBySorting().
|
static |
Definition at line 209 of file BlockFrequencyInfoImpl.cpp.
References combineWeightsByHashing(), and combineWeightsBySorting().
Referenced by llvm::BlockFrequencyInfoImplBase::Distribution::normalize().
|
static |
Definition at line 193 of file BlockFrequencyInfoImpl.cpp.
References combineWeight(), I, llvm::MapVector< KeyT, ValueT, MapType, VectorType, N >::reserve(), and llvm::MapVector< KeyT, ValueT, MapType, VectorType, N >::size().
Referenced by combineWeights().
|
static |
Definition at line 172 of file BlockFrequencyInfoImpl.cpp.
References combineWeight(), E(), I, and llvm::sort().
Referenced by combineWeights().
|
static |
Definition at line 453 of file BlockFrequencyInfoImpl.cpp.
References llvm::dbgs(), F, llvm::BlockFrequencyInfoImplBase::Freqs, llvm::BlockFrequencyInfoImplBase::getBlockName(), LLVM_DEBUG, Scaled, and uint64_t.
Referenced by llvm::BlockFrequencyInfoImplBase::finalizeMetrics().
|
static |
Package SCC into a loop represented by its lowest-RPO member.
Definition at line 646 of file BlockFrequencyInfoImpl.cpp.
References llvm::dbgs(), G, llvm::BlockFrequencyInfoImplBase::getBlockName(), I, llvm::BlockFrequencyInfoImplBase::IsIrrLoopHeader, LLVM_DEBUG, llvm::BlockFrequencyInfoImplBase::Loops, N, llvm::SparseBitVector< ElementSize >::set(), llvm::sort(), llvm::BitVector::test(), and llvm::BlockFrequencyInfoImplBase::Working.
Referenced by llvm::BlockFrequencyInfoImplBase::analyzeIrreducible().
|
static |
Definition at line 406 of file BlockFrequencyInfoImpl.cpp.
References D(), llvm::dbgs(), llvm::BlockFrequencyInfoImplBase::getBlockName(), and T.
Referenced by llvm::BlockFrequencyInfoImplBase::distributeMass().
|
static |
Definition at line 69 of file BlockFrequencyInfoImpl.cpp.
Referenced by llvm::bfi_detail::BlockMass::print().
Definition at line 219 of file BlockFrequencyInfoImpl.cpp.
References assert(), N, and uint64_t.
Referenced by llvm::BlockFrequencyInfoImplBase::Distribution::normalize().
|
static |
Unwrap a loop package.
Visits all the members of a loop, adjusting their BlockData according to the loop's pseudo-node.
Definition at line 493 of file BlockFrequencyInfoImpl.cpp.
References llvm::dbgs(), F, llvm::BlockFrequencyInfoImplBase::Freqs, llvm::BlockFrequencyInfoImplBase::getBlockName(), llvm::BlockFrequencyInfoImplBase::getLoopName(), LLVM_DEBUG, N, and llvm::BlockFrequencyInfoImplBase::Working.
Referenced by llvm::BlockFrequencyInfoImplBase::unwrapLoops().