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 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 createdInstr (MachineInstr &MI) override
 An instruction has been created and inserted into the function.
 
void erasingInstr (MachineInstr &MI) override
 An instruction is about to be erased.
 
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.
 

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 77 of file InstructionSelect.cpp.

Member Function Documentation

◆ changedInstr()

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

This instruction was mutated in some way.

Implements llvm::GISelChangeObserver.

Definition at line 87 of file InstructionSelect.cpp.

References llvm_unreachable.

◆ changingInstr()

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

This instruction is about to be mutated in some way.

Implements llvm::GISelChangeObserver.

Definition at line 84 of file InstructionSelect.cpp.

References llvm_unreachable.

◆ createdInstr()

void llvm::InstructionSelect::MIIteratorMaintainer::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 91 of file InstructionSelect.cpp.

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

◆ erasingInstr()

void llvm::InstructionSelect::MIIteratorMaintainer::erasingInstr ( 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: