mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-04-14 13:40:10 +00: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:
parent
4149bc8110
commit
002d0619e3
@ -188,10 +188,10 @@ bool SpillPlacement::runOnMachineFunction(MachineFunction &mf) {
|
|||||||
|
|
||||||
// Compute total ingoing and outgoing block frequencies for all bundles.
|
// Compute total ingoing and outgoing block frequencies for all bundles.
|
||||||
BlockFrequencies.resize(mf.getNumBlockIDs());
|
BlockFrequencies.resize(mf.getNumBlockIDs());
|
||||||
MachineBlockFrequencyInfo &MBFI = getAnalysis<MachineBlockFrequencyInfo>();
|
MBFI = &getAnalysis<MachineBlockFrequencyInfo>();
|
||||||
for (MachineFunction::iterator I = mf.begin(), E = mf.end(); I != E; ++I) {
|
for (MachineFunction::iterator I = mf.begin(), E = mf.end(); I != E; ++I) {
|
||||||
unsigned Num = I->getNumber();
|
unsigned Num = I->getNumber();
|
||||||
BlockFrequencies[Num] = MBFI.getBlockFreq(I);
|
BlockFrequencies[Num] = MBFI->getBlockFreq(I);
|
||||||
}
|
}
|
||||||
|
|
||||||
// We never change the function.
|
// We never change the function.
|
||||||
@ -221,7 +221,7 @@ void SpillPlacement::activate(unsigned n) {
|
|||||||
// Hopfield network.
|
// Hopfield network.
|
||||||
if (bundles->getBlocks(n).size() > 100) {
|
if (bundles->getBlocks(n).size() > 100) {
|
||||||
nodes[n].BiasP = 0;
|
nodes[n].BiasP = 0;
|
||||||
nodes[n].BiasN = (BlockFrequency::getEntryFrequency() / 16);
|
nodes[n].BiasN = (MBFI->getEntryFrequency() / 16);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -38,12 +38,14 @@ class BitVector;
|
|||||||
class EdgeBundles;
|
class EdgeBundles;
|
||||||
class MachineBasicBlock;
|
class MachineBasicBlock;
|
||||||
class MachineLoopInfo;
|
class MachineLoopInfo;
|
||||||
|
class MachineBlockFrequencyInfo;
|
||||||
|
|
||||||
class SpillPlacement : public MachineFunctionPass {
|
class SpillPlacement : public MachineFunctionPass {
|
||||||
struct Node;
|
struct Node;
|
||||||
const MachineFunction *MF;
|
const MachineFunction *MF;
|
||||||
const EdgeBundles *bundles;
|
const EdgeBundles *bundles;
|
||||||
const MachineLoopInfo *loops;
|
const MachineLoopInfo *loops;
|
||||||
|
const MachineBlockFrequencyInfo *MBFI;
|
||||||
Node *nodes;
|
Node *nodes;
|
||||||
|
|
||||||
// Nodes that are active in the current computation. Owned by the prepare()
|
// Nodes that are active in the current computation. Owned by the prepare()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user