LLVM
8.0.1
|
#include "llvm/Analysis/BlockFrequencyInfoImpl.h"
#include "llvm/ADT/APInt.h"
#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/GraphTraits.h"
#include "llvm/ADT/None.h"
#include "llvm/ADT/SCCIterator.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/ScaledNumber.h"
#include "llvm/Support/MathExtras.h"
#include "llvm/Support/raw_ostream.h"
#include <algorithm>
#include <cassert>
#include <cstddef>
#include <cstdint>
#include <iterator>
#include <list>
#include <numeric>
#include <utility>
#include <vector>
Go to the source code of this file.
Classes | |
struct | llvm::GraphTraits< IrreducibleGraph > |
Namespaces | |
llvm | |
This class represents lattice values for constants. | |
Macros | |
#define | DEBUG_TYPE "block-freq" |
Functions | |
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. More... | |
static void | debugAssign (const BlockFrequencyInfoImplBase &BFI, const DitheringDistributer &D, const BlockNode &T, const BlockMass &M, const char *Desc) |
static void | convertFloatingToInteger (BlockFrequencyInfoImplBase &BFI, const Scaled64 &Min, const Scaled64 &Max) |
static void | unwrapLoop (BlockFrequencyInfoImplBase &BFI, LoopData &Loop) |
Unwrap a loop package. More... | |
static void | findIrreducibleHeaders (const BlockFrequencyInfoImplBase &BFI, const IrreducibleGraph &G, const std::vector< const IrreducibleGraph::IrrNode *> &SCC, LoopData::NodeList &Headers, LoopData::NodeList &Others) |
Find extra irreducible headers. More... | |
static void | createIrreducibleLoop (BlockFrequencyInfoImplBase &BFI, const IrreducibleGraph &G, LoopData *OuterLoop, std::list< LoopData >::iterator Insert, const std::vector< const IrreducibleGraph::IrrNode *> &SCC) |
#define DEBUG_TYPE "block-freq" |
Definition at line 42 of file BlockFrequencyInfoImpl.cpp.
|
static |
Clear all memory not needed downstream.
Releases all memory not used downstream. In particular, saves Freqs.
Definition at line 283 of file BlockFrequencyInfoImpl.cpp.
References llvm::BlockFrequencyInfoImplBase::clear(), llvm::BlockFrequencyInfoImplBase::Freqs, and llvm::BlockFrequencyInfoImplBase::IsIrrLoopHeader.
Referenced by llvm::CrashRecoveryContext::CrashRecoveryContext(), llvm::BlockFrequencyInfoImplBase::finalizeMetrics(), llvm::FPPassManager::FPPassManager(), llvm::CrashRecoveryContext::registerCleanup(), llvm::Float2IntPass::runImpl(), and llvm::CrashRecoveryContext::unregisterCleanup().
|
static |
Definition at line 141 of file BlockFrequencyInfoImpl.cpp.
References assert(), and UINT64_MAX.
Referenced by combineWeightsByHashing(), and combineWeightsBySorting().
|
static |
Definition at line 197 of file BlockFrequencyInfoImpl.cpp.
References combineWeightsByHashing(), and combineWeightsBySorting().
Referenced by llvm::BlockFrequencyInfoImplBase::Distribution::normalize().
|
static |
Definition at line 178 of file BlockFrequencyInfoImpl.cpp.
References combineWeight(), I, llvm::NextPowerOf2(), and llvm::RISCVFenceField::W.
Referenced by combineWeights().
|
static |
Definition at line 157 of file BlockFrequencyInfoImpl.cpp.
References combineWeight(), E, I, llvm::RISCVFenceField::O, and llvm::sort().
Referenced by combineWeights().
|
static |
Definition at line 461 of file BlockFrequencyInfoImpl.cpp.
References llvm::dbgs(), llvm::BlockFrequencyInfoImplBase::Freqs, llvm::BlockFrequencyInfoImplBase::getBlockName(), llvm::ScaledNumber< DigitsT >::inverse(), LLVM_DEBUG, llvm::max(), and llvm::ScaledNumber< DigitsT >::toInt().
Referenced by llvm::BlockFrequencyInfoImplBase::finalizeMetrics().
|
static |
Definition at line 749 of file BlockFrequencyInfoImpl.cpp.
References llvm::dbgs(), findIrreducibleHeaders(), LLVM_DEBUG, llvm::BlockFrequencyInfoImplBase::Loops, N, and llvm::BlockFrequencyInfoImplBase::Working.
Referenced by llvm::BlockFrequencyInfoImplBase::analyzeIrreducible().
|
static |
Definition at line 414 of file BlockFrequencyInfoImpl.cpp.
References llvm::dbgs(), and llvm::BlockFrequencyInfoImplBase::getBlockName().
Referenced by llvm::BlockFrequencyInfoImplBase::adjustLoopHeaderMass(), llvm::BlockFrequencyInfoImplBase::distributeIrrLoopHeaderMass(), and llvm::BlockFrequencyInfoImplBase::distributeMass().
|
static |
Find extra irreducible headers.
Find entry blocks and other blocks with backedges, which exist when G
contains irreducible sub-SCCs.
Definition at line 680 of file BlockFrequencyInfoImpl.cpp.
References assert(), llvm::DenseMapBase< SmallDenseMap< KeyT, ValueT, InlineBuckets, KeyInfoT, BucketT >, KeyT, ValueT, KeyInfoT, BucketT >::begin(), llvm::DenseMapBase< SmallDenseMap< KeyT, ValueT, InlineBuckets, KeyInfoT, BucketT >, KeyT, ValueT, KeyInfoT, BucketT >::count(), llvm::dbgs(), E, llvm::DenseMapBase< SmallDenseMap< KeyT, ValueT, InlineBuckets, KeyInfoT, BucketT >, KeyT, ValueT, KeyInfoT, BucketT >::end(), llvm::BlockFrequencyInfoImplBase::getBlockName(), I, LLVM_DEBUG, llvm::make_range(), P, llvm::DenseMapBase< SmallDenseMap< KeyT, ValueT, InlineBuckets, KeyInfoT, BucketT >, KeyT, ValueT, KeyInfoT, BucketT >::size(), and llvm::sort().
Referenced by createIrreducibleLoop().
|
static |
Definition at line 54 of file BlockFrequencyInfoImpl.cpp.
Referenced by llvm::bfi_detail::BlockMass::print().
|
static |
Definition at line 207 of file BlockFrequencyInfoImpl.cpp.
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 500 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().