LLVM 23.0.0git
HexagonLiveVariables.cpp File Reference

Go to the source code of this file.

Macros

#define DEBUG_TYPE   "hexagon_live_vars"

Functions

 INITIALIZE_PASS (HexagonLiveVariables, "hexagon-live-vars", "Hexagon Live Variable Analysis", false, false) class HexagonLiveVariablesImpl
static void gatherBlocksDF (MachineFunction &Fn, SmallVectorImpl< MachineBasicBlock * > *Blocks)

Macro Definition Documentation

◆ DEBUG_TYPE

#define DEBUG_TYPE   "hexagon_live_vars"

Definition at line 14 of file HexagonLiveVariables.cpp.

Function Documentation

◆ gatherBlocksDF()

◆ INITIALIZE_PASS()

INITIALIZE_PASS ( HexagonLiveVariables ,
"hexagon-live-vars" ,
"Hexagon Live Variable Analysis" ,
false ,
false  )

PhysRegInfo - Keep track of which instruction was the last def of a physical register (possibly after a use). This is purely local to a BB.

PhysRegInfo - Keep track of which instruction was the last use of a physical register (before any def). This is purely local property to a BB.

MBB -> (Uses, Defs) Uses - use before any def in that MBB. Defs - def before any uses in that MBB.

MI -> (Uses, Defs)

Live-out data for each MBB => U LiveIns (For all Successors of a MBB).

Each MachineBasicBlock is assigned a Distance which is an approximation of MBB->size()*INSTR_SIZE+Some offsets. This is helpful in quickly finding distance between a branch and its target.

Note
A pass which moves instructions should update this.
The data in distance map should be used carefully because difference in the distances of two MI might not give relative distances between them. The DistanceMap is mainly useful during pullup.

Constructs use-defs of MBB by analyzing each MachineOperand. Collects relevant information so that global liveness can be updated.

Collects used-before-define set of registers. A register is considered to be completely defined if

  1. The register
  2. Any of its super-reg
  3. All of its subregs are defined. In these cases the register is not considered as used-before-defined. In case of partial definition of a register before its use, only the remaining subregs are included in the use-set.
    Note
    : Assumes that a register can be completely defined, by defining all of its sub-regs (if any).
    Collects defined-before-use set of registers. If there is any use of register or its aliases then the register is not counted as defined-before-use
    Note
    : Assumes that a register can be completely defined, by defining all of its sub-regs (if any).
    updateGlobalLiveness - wrapper around another overload

updateGlobalLiveness - updates liveness based on livein and liveout entries.

update live-ins when live-out has been calculated

updateLocalLiveness - update only kill flags of operands.

updateLocalLiveness - update only kill flags of operands.

incrementalUpdate - update the liveness when MIDelta is moved from From to To.

Note
: This is extremely fragile now. It 'assumes' that the other successor(s) of To do not use Defs of MIDelta. It deletes the live-in of the From MBB.

addNewMBB - inform the LiveVariable Analysis that new MBB has been added. update the liveness of this new MBB.

Note
MBB should be empty. If we want to add an MI, add it after calling this function.

Computes DistanceMap.

Definition at line 31 of file HexagonLiveVariables.cpp.

References llvm::HexagonLiveVariables::addNewMBB(), llvm::HexagonLiveVariables::addNewMI(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::clear(), llvm::HexagonLiveVariables::constructUseDef(), llvm::HexagonLiveVariables::incrementalUpdate(), MBB, MI, MRI, llvm::HexagonLiveVariables::runOnMachineFunction(), TRI, UpdateBundle(), llvm::HexagonLiveVariables::updateLocalLiveness(), Uses, X, and Y.