mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-04-13 15:37:24 +00:00
blockfreq: Rename PackagedLoopData => LoopData
No functionality change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206855 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
df1956a475
commit
aa866b9ae7
@ -937,15 +937,11 @@ public:
|
||||
uint64_t Integer;
|
||||
};
|
||||
|
||||
/// \brief Data for a packaged loop.
|
||||
/// \brief Data about a loop.
|
||||
///
|
||||
/// Contains the data necessary to represent represent a loop as a node once
|
||||
/// it's packaged.
|
||||
///
|
||||
/// PackagedLoopData inherits from BlockData to give the node the necessary
|
||||
/// stats. Further, it has a list of successors, list of members, and stores
|
||||
/// the backedge mass assigned to this loop.
|
||||
struct PackagedLoopData {
|
||||
/// Contains the data necessary to represent represent a loop as a
|
||||
/// pseudo-node once it's packaged.
|
||||
struct LoopData {
|
||||
typedef SmallVector<std::pair<BlockNode, BlockMass>, 4> ExitMap;
|
||||
typedef SmallVector<BlockNode, 4> MemberList;
|
||||
BlockNode Header; ///< Header.
|
||||
@ -955,7 +951,7 @@ public:
|
||||
BlockMass Mass;
|
||||
Float Scale;
|
||||
|
||||
PackagedLoopData(const BlockNode &Header) : Header(Header) {}
|
||||
LoopData(const BlockNode &Header) : Header(Header) {}
|
||||
};
|
||||
|
||||
/// \brief Index of loop information.
|
||||
@ -1044,7 +1040,7 @@ public:
|
||||
std::vector<WorkingData> Working;
|
||||
|
||||
/// \brief Indexed information about packaged loops.
|
||||
std::vector<PackagedLoopData> PackagedLoops;
|
||||
std::vector<LoopData> PackagedLoops;
|
||||
|
||||
/// \brief Add all edges out of a packaged loop to the distribution.
|
||||
///
|
||||
@ -1063,7 +1059,7 @@ public:
|
||||
void addToDist(Distribution &Dist, const BlockNode &LoopHead,
|
||||
const BlockNode &Pred, const BlockNode &Succ, uint64_t Weight);
|
||||
|
||||
PackagedLoopData &getLoopPackage(const BlockNode &Head) {
|
||||
LoopData &getLoopPackage(const BlockNode &Head) {
|
||||
assert(Head.Index < Working.size());
|
||||
size_t Index = Working[Head.Index].LoopIndex;
|
||||
assert(Index < PackagedLoops.size());
|
||||
@ -1221,7 +1217,7 @@ template <> inline std::string getBlockName(const BasicBlock *BB) {
|
||||
///
|
||||
/// - Fetch and categorize the weight distribution for its successors.
|
||||
/// If this is a packaged-subloop, the weight distribution is stored
|
||||
/// in \a PackagedLoopData::Exits. Otherwise, fetch it from
|
||||
/// in \a LoopData::Exits. Otherwise, fetch it from
|
||||
/// BranchProbabilityInfo.
|
||||
///
|
||||
/// - Each successor is categorized as \a Weight::Local, a normal
|
||||
|
@ -367,7 +367,7 @@ typedef BlockFrequencyInfoImplBase::BlockNode BlockNode;
|
||||
typedef BlockFrequencyInfoImplBase::Distribution Distribution;
|
||||
typedef BlockFrequencyInfoImplBase::Distribution::WeightList WeightList;
|
||||
typedef BlockFrequencyInfoImplBase::Float Float;
|
||||
typedef BlockFrequencyInfoImplBase::PackagedLoopData PackagedLoopData;
|
||||
typedef BlockFrequencyInfoImplBase::LoopData LoopData;
|
||||
typedef BlockFrequencyInfoImplBase::Weight Weight;
|
||||
typedef BlockFrequencyInfoImplBase::FrequencyData FrequencyData;
|
||||
|
||||
@ -696,8 +696,8 @@ void BlockFrequencyInfoImplBase::addToDist(Distribution &Dist,
|
||||
void BlockFrequencyInfoImplBase::addLoopSuccessorsToDist(
|
||||
const BlockNode &LoopHead, const BlockNode &LocalLoopHead,
|
||||
Distribution &Dist) {
|
||||
PackagedLoopData &LoopPackage = getLoopPackage(LocalLoopHead);
|
||||
const PackagedLoopData::ExitMap &Exits = LoopPackage.Exits;
|
||||
LoopData &LoopPackage = getLoopPackage(LocalLoopHead);
|
||||
const LoopData::ExitMap &Exits = LoopPackage.Exits;
|
||||
|
||||
// Copy the exit map into Dist.
|
||||
for (const auto &I : Exits)
|
||||
@ -721,7 +721,7 @@ void BlockFrequencyInfoImplBase::computeLoopScale(const BlockNode &LoopHead) {
|
||||
|
||||
// LoopScale == 1 / ExitMass
|
||||
// ExitMass == HeadMass - BackedgeMass
|
||||
PackagedLoopData &LoopPackage = getLoopPackage(LoopHead);
|
||||
LoopData &LoopPackage = getLoopPackage(LoopHead);
|
||||
BlockMass ExitMass = BlockMass::getFull() - LoopPackage.BackedgeMass;
|
||||
|
||||
// Block scale stores the inverse of the scale.
|
||||
@ -771,7 +771,7 @@ void BlockFrequencyInfoImplBase::distributeMass(const BlockNode &Source,
|
||||
(void)debugAssign;
|
||||
#endif
|
||||
|
||||
PackagedLoopData *LoopPackage = 0;
|
||||
LoopData *LoopPackage = 0;
|
||||
if (LoopHead.isValid())
|
||||
LoopPackage = &getLoopPackage(LoopHead);
|
||||
for (const Weight &W : Dist.Weights) {
|
||||
@ -829,7 +829,7 @@ static void convertFloatingToInteger(BlockFrequencyInfoImplBase &BFI,
|
||||
|
||||
static void scaleBlockData(BlockFrequencyInfoImplBase &BFI,
|
||||
const BlockNode &Node,
|
||||
const PackagedLoopData &Loop) {
|
||||
const LoopData &Loop) {
|
||||
Float F = Loop.Mass.toFloat() * Loop.Scale;
|
||||
|
||||
Float &Current = BFI.Freqs[Node.Index].Floating;
|
||||
@ -849,7 +849,7 @@ static void unwrapLoopPackage(BlockFrequencyInfoImplBase &BFI,
|
||||
const BlockNode &Head) {
|
||||
assert(Head.isValid());
|
||||
|
||||
PackagedLoopData &LoopPackage = BFI.getLoopPackage(Head);
|
||||
LoopData &LoopPackage = BFI.getLoopPackage(Head);
|
||||
DEBUG(dbgs() << "unwrap-loop-package: " << BFI.getBlockName(Head)
|
||||
<< ": mass = " << LoopPackage.Mass
|
||||
<< ", scale = " << LoopPackage.Scale << "\n");
|
||||
|
Loading…
x
Reference in New Issue
Block a user