Go to the documentation of this file.
33 #define DEBUG_TYPE "wasm-optimize-live-intervals"
38 return "WebAssembly Optimize Live Intervals";
67 "Optimize LiveIntervals for WebAssembly",
false,
false)
70 return new WebAssemblyOptimizeLiveIntervals();
73 bool WebAssemblyOptimizeLiveIntervals::runOnMachineFunction(
75 LLVM_DEBUG(
dbgs() <<
"********** Optimize LiveIntervals **********\n"
76 "********** Function: "
80 auto &LIS = getAnalysis<LiveIntervals>();
96 LIS.splitSeparateComponents(LIS.getInterval(
Reg), SplitLIs);
105 SplitLIs.back()->reg());
115 if (
MI.isImplicitDef() &&
MI.getOperand(0).isDead()) {
117 LIS.removeVRegDefAt(LI, LIS.getInstructionIndex(
MI).getRegSlot());
118 LIS.RemoveMachineInstrFromMaps(
MI);
119 MI.eraseFromParent();
This is an optimization pass for GlobalISel generic memory operations.
MachineRegisterInfo - Keep track of information for virtual and physical registers,...
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
Reg
All possible values of the reg field in the ModR/M byte.
MachineFunctionPass - This class adapts the FunctionPass interface to allow convenient creation of pa...
Properties which a MachineFunction may have at a given point in time.
unsigned getNumVirtRegs() const
getNumVirtRegs - Return the number of virtual registers created.
static Register index2VirtReg(unsigned Index)
Convert a 0-based index to a virtual register number.
unsigned const TargetRegisterInfo * TRI
void getAnalysisUsage(AnalysisUsage &AU) const override
getAnalysisUsage - Subclasses that override getAnalysisUsage must call this.
bool tracksLiveness() const
tracksLiveness - Returns true when tracking register liveness accurately.
raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.
const MachineBasicBlock & front() const
MachineRegisterInfo & getRegInfo()
getRegInfo - Return information about the registers currently in use.
MachineBlockFrequencyInfo pass uses BlockFrequencyInfoImpl implementation to estimate machine basic b...
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
Ty * getInfo()
getInfo - Keep track of various per-function pieces of information for backends that would like to do...
Represent the analysis usage information of a pass.
MachineFunctionProperties & set(Property P)
INITIALIZE_PASS(WebAssemblyOptimizeLiveIntervals, DEBUG_TYPE, "Optimize LiveIntervals for WebAssembly", false, false) FunctionPass *llvm
FunctionPass * createWebAssemblyOptimizeLiveIntervals()
LiveInterval - This class represents the liveness of a register, or stack slot.
unsigned ID
LLVM IR allows to use arbitrary numbers as calling convention identifiers.
const TargetSubtargetInfo & getSubtarget() const
getSubtarget - Return the subtarget for which this machine code is being compiled.
Representation of each machine instruction.
virtual Register getFrameRegister(const MachineFunction &MF) const =0
Debug information queries.
iterator_range< early_inc_iterator_impl< detail::IterOfRange< RangeT > > > make_early_inc_range(RangeT &&Range)
Make a range that does early increment to allow mutation of the underlying range without disrupting i...
char & LiveVariablesID
LiveVariables pass - This pass computes the set of blocks in which each variable is life and sets mac...
StringRef getName() const
getName - Return the name of the corresponding LLVM function.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
This class is derived from MachineFunctionInfo and contains private WebAssembly-specific information ...
void setPreservesCFG()
This function should be called by the pass, iff they do not:
StringRef - Represent a constant reference to a string, i.e.
AnalysisUsage & addPreservedID(const void *ID)
AnalysisUsage & addPreserved()
Add the specified Pass class to the set of analyses preserved by this pass.
unsigned const MachineRegisterInfo * MRI
Wrapper class representing virtual and physical registers.
char & MachineDominatorsID
MachineDominators - This pass is a machine dominators analysis pass.
FunctionPass class - This class is used to implement most global optimizations.
AnalysisUsage & addRequired()
bool reg_nodbg_empty(Register RegNo) const
reg_nodbg_empty - Return true if the only instructions using or defining Reg are Debug instructions.