1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 11:13:28 +01:00

[block-freq] Store MBFI as a field on SpillPlacement so we can access it to get the entry frequency while processing data.

llvm-svn: 197291
This commit is contained in:
Michael Gottesman 2013-12-14 00:25:47 +00:00
parent 4149bc8110
commit 002d0619e3
2 changed files with 5 additions and 3 deletions

View File

@ -188,10 +188,10 @@ bool SpillPlacement::runOnMachineFunction(MachineFunction &mf) {
// Compute total ingoing and outgoing block frequencies for all bundles.
BlockFrequencies.resize(mf.getNumBlockIDs());
MachineBlockFrequencyInfo &MBFI = getAnalysis<MachineBlockFrequencyInfo>();
MBFI = &getAnalysis<MachineBlockFrequencyInfo>();
for (MachineFunction::iterator I = mf.begin(), E = mf.end(); I != E; ++I) {
unsigned Num = I->getNumber();
BlockFrequencies[Num] = MBFI.getBlockFreq(I);
BlockFrequencies[Num] = MBFI->getBlockFreq(I);
}
// We never change the function.
@ -221,7 +221,7 @@ void SpillPlacement::activate(unsigned n) {
// Hopfield network.
if (bundles->getBlocks(n).size() > 100) {
nodes[n].BiasP = 0;
nodes[n].BiasN = (BlockFrequency::getEntryFrequency() / 16);
nodes[n].BiasN = (MBFI->getEntryFrequency() / 16);
}
}

View File

@ -38,12 +38,14 @@ class BitVector;
class EdgeBundles;
class MachineBasicBlock;
class MachineLoopInfo;
class MachineBlockFrequencyInfo;
class SpillPlacement : public MachineFunctionPass {
struct Node;
const MachineFunction *MF;
const EdgeBundles *bundles;
const MachineLoopInfo *loops;
const MachineBlockFrequencyInfo *MBFI;
Node *nodes;
// Nodes that are active in the current computation. Owned by the prepare()