33 #define DEBUG_TYPE "wasm-optimize-live-intervals"
38 return "WebAssembly Optimize Live Intervals";
62 return new WebAssemblyOptimizeLiveIntervals();
65 bool WebAssemblyOptimizeLiveIntervals::runOnMachineFunction(
MachineFunction &MF) {
66 DEBUG(
dbgs() <<
"********** Optimize LiveIntervals **********\n"
67 "********** Function: "
76 assert(MRI.tracksLiveness() &&
77 "OptimizeLiveIntervals expects liveness");
81 for (
unsigned i = 0, e = MRI.getNumVirtRegs();
i < e; ++
i) {
83 if (MRI.reg_nodbg_empty(Reg))
94 for (
auto MII = MF.
begin()->begin(), MIE = MF.
begin()->end(); MII != MIE; ) {
AnalysisUsage & addPreserved()
Add the specified Pass class to the set of analyses preserved by this pass.
void RemoveMachineInstrFromMaps(MachineInstr &MI)
static unsigned index2VirtReg(unsigned Index)
Convert a 0-based index to a virtual register number.
char & MachineDominatorsID
MachineDominators - This pass is a machine dominators analysis pass.
LiveInterval - This class represents the liveness of a register, or stack slot.
MachineBlockFrequencyInfo pass uses BlockFrequencyInfoImpl implementation to estimate machine basic b...
FunctionPass * createWebAssemblyOptimizeLiveIntervals()
SlotIndex getInstructionIndex(const MachineInstr &Instr) const
Returns the base index of the given instruction.
void splitSeparateComponents(LiveInterval &LI, SmallVectorImpl< LiveInterval * > &SplitLIs)
Split separate components in LiveInterval LI into separate intervals.
This file contains the entry points for global functions defined in the LLVM WebAssembly back-end...
AnalysisUsage & addRequired()
MachineFunctionPass - This class adapts the FunctionPass interface to allow convenient creation of pa...
void eraseFromParent()
Unlink 'this' from the containing basic block and delete it.
Reg
All possible values of the reg field in the ModR/M byte.
AnalysisUsage & addPreservedID(const void *ID)
bool isImplicitDef() const
char & LiveVariablesID
LiveVariables pass - This pass computes the set of blocks in which each variable is life and sets mac...
unsigned const MachineRegisterInfo * MRI
void getAnalysisUsage(AnalysisUsage &AU) const override
getAnalysisUsage - Subclasses that override getAnalysisUsage must call this.
const MachineOperand & getOperand(unsigned i) const
Represent the analysis usage information of a pass.
FunctionPass class - This class is used to implement most global optimizations.
This file declares the WebAssembly-specific subclass of TargetSubtarget.
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small...
void setPreservesCFG()
This function should be called by the pass, iff they do not:
LiveInterval & getInterval(unsigned Reg)
raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.
MachineRegisterInfo - Keep track of information for virtual and physical registers, including vreg register classes, use/def chains for registers, etc.
Representation of each machine instruction.
MachineRegisterInfo & getRegInfo()
getRegInfo - Return information about the registers currently in use.
SlotIndex getRegSlot(bool EC=false) const
Returns the register use/def slot in the current instruction for a normal or early-clobber def...
unsigned getReg() const
getReg - Returns the register number.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
StringRef - Represent a constant reference to a string, i.e.
StringRef getName() const
getName - Return the name of the corresponding LLVM function.
void removeVRegDefAt(LiveInterval &LI, SlotIndex Pos)
Remove value number and related live segments of LI and its subranges that start at position Pos...