mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-18 11:24:01 +00:00
Add comments, add a vector to keep track of which registers are allocatable
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6014 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -1,12 +1,21 @@
|
|||||||
//===-- llvm/CodeGen/LiveVariables.h - Live Variable Analysis ---*- C++ -*-===//
|
//===-- llvm/CodeGen/LiveVariables.h - Live Variable Analysis ---*- C++ -*-===//
|
||||||
//
|
//
|
||||||
|
// This file implements the LiveVariable analysis pass. For each machine
|
||||||
|
// instruction in the function, this pass calculates the set of registers that
|
||||||
|
// are immediately dead after the instruction (i.e., the instruction calculates
|
||||||
|
// the value, but it is never used) and the set of registers that are used by
|
||||||
|
// the instruction, but are never used after the instruction (i.e., they are
|
||||||
|
// killed).
|
||||||
|
//
|
||||||
// This class computes live variables using are sparse implementation based on
|
// This class computes live variables using are sparse implementation based on
|
||||||
// the machine code SSA form. This class computes live variable information for
|
// the machine code SSA form. This class computes live variable information for
|
||||||
// each virtual and physical register in a function. It uses the dominance
|
// each virtual and _register allocatable_ physical register in a function. It
|
||||||
// properties of SSA form to efficiently compute live variables for virtual
|
// uses the dominance properties of SSA form to efficiently compute live
|
||||||
// registers, and assumes that physical registers are only live within a single
|
// variables for virtual registers, and assumes that physical registers are only
|
||||||
// basic block (allowing it to do a single local analysis to resolve physical
|
// live within a single basic block (allowing it to do a single local analysis
|
||||||
// register lifetimes in each basic block).
|
// to resolve physical register lifetimes in each basic block). If a physical
|
||||||
|
// register is not register allocatable, it is not tracked. This is useful for
|
||||||
|
// things like the stack pointer and condition codes.
|
||||||
//
|
//
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
|
|
||||||
@ -58,6 +67,11 @@ class LiveVariables : public MachineFunctionPass {
|
|||||||
///
|
///
|
||||||
std::multimap<MachineInstr*, unsigned> RegistersDead;
|
std::multimap<MachineInstr*, unsigned> RegistersDead;
|
||||||
|
|
||||||
|
/// AllocatablePhysicalRegisters - This vector keeps track of which registers
|
||||||
|
/// are actually register allocatable by the target machine. We can not track
|
||||||
|
/// liveness for values that are not in this set.
|
||||||
|
///
|
||||||
|
std::vector<bool> AllocatablePhysicalRegisters;
|
||||||
private: // Intermediate data structures
|
private: // Intermediate data structures
|
||||||
|
|
||||||
/// BBMap - Maps LLVM basic blocks to their corresponding machine basic block.
|
/// BBMap - Maps LLVM basic blocks to their corresponding machine basic block.
|
||||||
|
Reference in New Issue
Block a user