LLVM 20.0.0git
Public Member Functions | Public Attributes | List of all members
llvm::InstructionSelect::MIIteratorMaintainer Class Reference

This class observes instruction insertions/removals. More...

Inheritance diagram for llvm::InstructionSelect::MIIteratorMaintainer:
Inheritance graph
[legend]

Public Member Functions

void MF_HandleInsertion (MachineInstr &MI) override
 Callback after an insertion. This should not modify the MI directly.
 
void MF_HandleRemoval (MachineInstr &MI) override
 Callback before a removal. This should not modify the MI directly.
 
void reportFullyCreatedInstrs ()
 
- Public Member Functions inherited from llvm::MachineFunction::Delegate
virtual ~Delegate ()=default
 
virtual void MF_HandleInsertion (MachineInstr &MI)=0
 Callback after an insertion. This should not modify the MI directly.
 
virtual void MF_HandleRemoval (MachineInstr &MI)=0
 Callback before a removal. This should not modify the MI directly.
 
virtual void MF_HandleChangeDesc (MachineInstr &MI, const MCInstrDesc &TID)
 Callback before changing MCInstrDesc.
 

Public Attributes

MachineBasicBlock::reverse_iterator MII
 

Detailed Description

This class observes instruction insertions/removals.

InstructionSelect stores an iterator of the instruction prior to the one that is currently being selected to determine which instruction to select next. Previously this meant that selecting multiple instructions at once was illegal behavior due to potential invalidation of this iterator. This is a non-obvious limitation for selector implementers. Therefore, to allow deletion of arbitrary instructions, we detect this case and continue selection with the predecessor of the deleted instruction.

Definition at line 78 of file InstructionSelect.cpp.

Member Function Documentation

◆ MF_HandleInsertion()

void llvm::InstructionSelect::MIIteratorMaintainer::MF_HandleInsertion ( MachineInstr MI)
inlineoverridevirtual

Callback after an insertion. This should not modify the MI directly.

Implements llvm::MachineFunction::Delegate.

Definition at line 86 of file InstructionSelect.cpp.

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

◆ MF_HandleRemoval()

void llvm::InstructionSelect::MIIteratorMaintainer::MF_HandleRemoval ( MachineInstr MI)
inlineoverridevirtual

◆ reportFullyCreatedInstrs()

void llvm::InstructionSelect::MIIteratorMaintainer::reportFullyCreatedInstrs ( )
inline

Member Data Documentation

◆ MII

MachineBasicBlock::reverse_iterator llvm::InstructionSelect::MIIteratorMaintainer::MII

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