#include "llvm/ExecutionEngine/Orc/SpeculateAnalyses.h"
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/Analysis/BlockFrequencyInfo.h"
#include "llvm/Analysis/BranchProbabilityInfo.h"
#include "llvm/Analysis/CFG.h"
#include "llvm/IR/PassManager.h"
#include "llvm/Passes/PassBuilder.h"
#include "llvm/Support/ErrorHandling.h"
#include <algorithm>
namespace {
usingnamespacellvm;
SmallVector<const BasicBlock *, 8> findBBwithCalls(const Function &F,
bool IndirectCall = false) { … }
}
namespace llvm {
namespace orc {
void SpeculateQuery::findCalles(const BasicBlock *BB,
DenseSet<StringRef> &CallesNames) { … }
bool SpeculateQuery::isStraightLine(const Function &F) { … }
size_t BlockFreqQuery::numBBToGet(size_t numBB) { … }
BlockFreqQuery::ResultTy BlockFreqQuery::operator()(Function &F) { … }
std::size_t SequenceBBQuery::getHottestBlocks(std::size_t TotalBlocks) { … }
SequenceBBQuery::BlockListTy
SequenceBBQuery::rearrangeBB(const Function &F, const BlockListTy &BBList) { … }
void SequenceBBQuery::traverseToEntryBlock(const BasicBlock *AtBB,
const BlockListTy &CallerBlocks,
const BackEdgesInfoTy &BackEdgesInfo,
const BranchProbabilityInfo *BPI,
VisitedBlocksInfoTy &VisitedBlocks) { … }
void SequenceBBQuery::traverseToExitBlock(const BasicBlock *AtBB,
const BlockListTy &CallerBlocks,
const BackEdgesInfoTy &BackEdgesInfo,
const BranchProbabilityInfo *BPI,
VisitedBlocksInfoTy &VisitedBlocks) { … }
SequenceBBQuery::BlockListTy
SequenceBBQuery::queryCFG(Function &F, const BlockListTy &CallerBlocks) { … }
SpeculateQuery::ResultTy SequenceBBQuery::operator()(Function &F) { … }
}
}