LLVM  16.0.0git
Classes | Namespaces | Functions
LivePhysRegs.h File Reference
#include "llvm/ADT/SparseSet.h"
#include "llvm/CodeGen/MachineBasicBlock.h"
#include "llvm/CodeGen/TargetRegisterInfo.h"
#include "llvm/MC/MCRegister.h"
#include "llvm/MC/MCRegisterInfo.h"
#include <cassert>
#include <utility>
Include dependency graph for LivePhysRegs.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.


class  llvm::LivePhysRegs
 A set of physical registers with utility functions to track liveness when walking backward/forward through a basic block. More...


 This is an optimization pass for GlobalISel generic memory operations.


raw_ostream & llvm::operator<< (raw_ostream &OS, const LivePhysRegs &LR)
void llvm::computeLiveIns (LivePhysRegs &LiveRegs, const MachineBasicBlock &MBB)
 Computes registers live-in to MBB assuming all of its successors live-in lists are up-to-date. More...
void llvm::recomputeLivenessFlags (MachineBasicBlock &MBB)
 Recomputes dead and kill flags in MBB. More...
void llvm::addLiveIns (MachineBasicBlock &MBB, const LivePhysRegs &LiveRegs)
 Adds registers contained in LiveRegs to the block live-in list of MBB. More...
void llvm::computeAndAddLiveIns (LivePhysRegs &LiveRegs, MachineBasicBlock &MBB)
 Convenience function combining computeLiveIns() and addLiveIns(). More...
static void llvm::recomputeLiveIns (MachineBasicBlock &MBB)
 Convenience function for recomputing live-in's for MBB. More...

Detailed Description

This file implements the LivePhysRegs utility for tracking liveness of physical registers. This can be used for ad-hoc liveness tracking after register allocation. You can start with the live-ins/live-outs at the beginning/end of a block and update the information while walking the instructions inside the block. This implementation tracks the liveness on a sub-register granularity.

We assume that the high bits of a physical super-register are not preserved unless the instruction has an implicit-use operand reading the super- register.

X86 Example: ymm0 = ... xmm0 = ... (Kills xmm0, all xmm0s sub-registers, and ymm0)

ymm0 = ... xmm0 = ..., implicit ymm0 (ymm0 and all its sub-registers are alive)

Definition in file LivePhysRegs.h.