LLVM 19.0.0git
Public Member Functions | List of all members
llvm::Combiner::WorkListMaintainer Class Reference

This class acts as the glue the joins the CombinerHelper to the overall Combine algorithm. More...

Inheritance diagram for llvm::Combiner::WorkListMaintainer:
Inheritance graph
[legend]

Public Member Functions

 WorkListMaintainer (WorkListTy &WorkList)
 
virtual ~WorkListMaintainer ()=default
 
void erasingInstr (MachineInstr &MI) override
 An instruction is about to be erased.
 
void createdInstr (MachineInstr &MI) override
 An instruction has been created and inserted into the function.
 
void changingInstr (MachineInstr &MI) override
 This instruction is about to be mutated in some way.
 
void changedInstr (MachineInstr &MI) override
 This instruction was mutated in some way.
 
void reportFullyCreatedInstrs ()
 
- Public Member Functions inherited from llvm::GISelChangeObserver
virtual ~GISelChangeObserver ()=default
 
virtual void erasingInstr (MachineInstr &MI)=0
 An instruction is about to be erased.
 
virtual void createdInstr (MachineInstr &MI)=0
 An instruction has been created and inserted into the function.
 
virtual void changingInstr (MachineInstr &MI)=0
 This instruction is about to be mutated in some way.
 
virtual void changedInstr (MachineInstr &MI)=0
 This instruction was mutated in some way.
 
void changingAllUsesOfReg (const MachineRegisterInfo &MRI, Register Reg)
 All the instructions using the given register are being changed.
 
void finishedChangingAllUsesOfReg ()
 All instructions reported as changing by changingAllUsesOfReg() have finished being changed.
 

Detailed Description

This class acts as the glue the joins the CombinerHelper to the overall Combine algorithm.

The CombinerHelper is intended to report the modifications it makes to the MIR to the GISelChangeObserver and the observer subclass will act on these events. In this case, instruction erasure will cancel any future visits to the erased instruction and instruction creation will schedule that instruction for a future visit. Other Combiner implementations may require more complex behaviour from their GISelChangeObserver subclass.

Definition at line 50 of file Combiner.cpp.

Constructor & Destructor Documentation

◆ WorkListMaintainer()

llvm::Combiner::WorkListMaintainer::WorkListMaintainer ( WorkListTy WorkList)
inline

Definition at line 60 of file Combiner.cpp.

◆ ~WorkListMaintainer()

virtual llvm::Combiner::WorkListMaintainer::~WorkListMaintainer ( )
virtualdefault

Member Function Documentation

◆ changedInstr()

void llvm::Combiner::WorkListMaintainer::changedInstr ( MachineInstr MI)
inlineoverridevirtual

This instruction was mutated in some way.

Implements llvm::GISelChangeObserver.

Definition at line 76 of file Combiner.cpp.

References llvm::dbgs(), llvm::GISelWorkList< N >::insert(), LLVM_DEBUG, and MI.

◆ changingInstr()

void llvm::Combiner::WorkListMaintainer::changingInstr ( MachineInstr MI)
inlineoverridevirtual

This instruction is about to be mutated in some way.

Implements llvm::GISelChangeObserver.

Definition at line 72 of file Combiner.cpp.

References llvm::dbgs(), llvm::GISelWorkList< N >::insert(), LLVM_DEBUG, and MI.

◆ createdInstr()

void llvm::Combiner::WorkListMaintainer::createdInstr ( MachineInstr MI)
inlineoverridevirtual

An instruction has been created and inserted into the function.

Note that the instruction might not be a fully fledged instruction at this point and won't be if the MachineFunction::Delegate is calling it. This is because the delegate only sees the construction of the MachineInstr before operands have been added.

Implements llvm::GISelChangeObserver.

Definition at line 67 of file Combiner.cpp.

References llvm::dbgs(), llvm::SetVector< T, Vector, Set, N >::insert(), llvm::GISelWorkList< N >::insert(), LLVM_DEBUG, and MI.

◆ erasingInstr()

void llvm::Combiner::WorkListMaintainer::erasingInstr ( MachineInstr MI)
inlineoverridevirtual

An instruction is about to be erased.

Implements llvm::GISelChangeObserver.

Definition at line 63 of file Combiner.cpp.

References llvm::dbgs(), LLVM_DEBUG, MI, and llvm::GISelWorkList< N >::remove().

◆ reportFullyCreatedInstrs()

void llvm::Combiner::WorkListMaintainer::reportFullyCreatedInstrs ( )
inline

Definition at line 81 of file Combiner.cpp.

References llvm::dbgs(), LLVM_DEBUG, MI, and llvm::Pass::print().


The documentation for this class was generated from the following file: