mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-21 02:24:22 +00:00
Precompute block frequencies, pow() isn't free.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126975 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -27,6 +27,7 @@
|
||||
#ifndef LLVM_CODEGEN_SPILLPLACEMENT_H
|
||||
#define LLVM_CODEGEN_SPILLPLACEMENT_H
|
||||
|
||||
#include "llvm/ADT/SmallVector.h"
|
||||
#include "llvm/CodeGen/MachineFunctionPass.h"
|
||||
|
||||
namespace llvm {
|
||||
@ -35,7 +36,6 @@ class BitVector;
|
||||
class EdgeBundles;
|
||||
class MachineBasicBlock;
|
||||
class MachineLoopInfo;
|
||||
template <typename> class SmallVectorImpl;
|
||||
|
||||
class SpillPlacement : public MachineFunctionPass {
|
||||
struct Node;
|
||||
@ -48,6 +48,9 @@ class SpillPlacement : public MachineFunctionPass {
|
||||
// caller.
|
||||
BitVector *ActiveNodes;
|
||||
|
||||
// Block frequencies are computed once. Indexed by block number.
|
||||
SmallVector<float, 4> BlockFrequency;
|
||||
|
||||
public:
|
||||
static char ID; // Pass identification, replacement for typeid.
|
||||
|
||||
@ -91,7 +94,9 @@ public:
|
||||
|
||||
/// getBlockFrequency - Return the estimated block execution frequency per
|
||||
/// function invocation.
|
||||
float getBlockFrequency(const MachineBasicBlock*);
|
||||
float getBlockFrequency(unsigned Number) const {
|
||||
return BlockFrequency[Number];
|
||||
}
|
||||
|
||||
private:
|
||||
virtual bool runOnMachineFunction(MachineFunction&);
|
||||
|
Reference in New Issue
Block a user