struct SpillPlacement::Node

Declaration

struct SpillPlacement::Node { /* full declaration omitted */ };

Description

Node - Each edge bundle corresponds to a Hopfield node. The node contains precomputed frequency data that only depends on the CFG, but Bias and Links are computed each time placeSpills is called. The node Value is positive when the variable should be in a register. The value can change when linked nodes change, but convergence is very fast because all weights are positive.

Declared at: llvm/lib/CodeGen/SpillPlacement.cpp:75

Member Variables

public llvm::BlockFrequency BiasN
BiasN - Sum of blocks that prefer a spill.
public llvm::BlockFrequency BiasP
BiasP - Sum of blocks that prefer a register.
public int Value
Value - Output value of this node computed from the Bias and links. This is always on of the values {-1, 0, 1}. A positive number means the variable should go in a register through this bundle.
Links - (Weight, BundleNo) for all transparent blocks connecting to other bundles. The weights are all positive block frequencies.
public llvm::BlockFrequency SumLinkWeights
SumLinkWeights - Cached sum of the weights of all links + ThresHold.

Method Overview

  • public void addBias(llvm::BlockFrequency freq, llvm::SpillPlacement::BorderConstraint direction)
  • public void addLink(unsigned int b, llvm::BlockFrequency w)
  • public void clear(const llvm::BlockFrequency & Threshold)
  • public void getDissentingNeighbors(SparseSet<unsigned int> & List, const llvm::SpillPlacement::Node * nodes) const
  • public bool mustSpill() const
  • public bool preferReg() const
  • public bool update(const llvm::SpillPlacement::Node * nodes, const llvm::BlockFrequency & Threshold)

Methods

void addBias(
    llvm::BlockFrequency freq,
    llvm::SpillPlacement::BorderConstraint
        direction)

Description

addBias - Bias this node.

Declared at: llvm/lib/CodeGen/SpillPlacement.cpp:134

Parameters

llvm::BlockFrequency freq
llvm::SpillPlacement::BorderConstraint direction

void addLink(unsigned int b,
             llvm::BlockFrequency w)

Description

addLink - Add a link to bundle b with weight w.

Declared at: llvm/lib/CodeGen/SpillPlacement.cpp:119

Parameters

unsigned int b
llvm::BlockFrequency w

void clear(const llvm::BlockFrequency& Threshold)

Description

clear - Reset per-query data, but preserve frequencies that only depend on the CFG.

Declared at: llvm/lib/CodeGen/SpillPlacement.cpp:112

Parameters

const llvm::BlockFrequency& Threshold

void getDissentingNeighbors(
    SparseSet<unsigned int>& List,
    const llvm::SpillPlacement::Node* nodes) const

Declared at: llvm/lib/CodeGen/SpillPlacement.cpp:181

Parameters

SparseSet<unsigned int>& List
const llvm::SpillPlacement::Node* nodes

bool mustSpill() const

Description

mustSpill - Return True if this node is so biased that it must spill.

Declared at: llvm/lib/CodeGen/SpillPlacement.cpp:103

bool preferReg() const

Description

preferReg - Return true when this node prefers to be in a register.

Declared at: llvm/lib/CodeGen/SpillPlacement.cpp:97

bool update(
    const llvm::SpillPlacement::Node* nodes,
    const llvm::BlockFrequency& Threshold)

Description

update - Recompute Value from Bias and Links. Return true when node preference changes.

Declared at: llvm/lib/CodeGen/SpillPlacement.cpp:152

Parameters

const llvm::SpillPlacement::Node* nodes
const llvm::BlockFrequency& Threshold