LLVM 22.0.0git
llvm::GISelChangeObserver Class Referenceabstract

Abstract class that contains various methods for clients to notify about changes. More...

#include "llvm/CodeGen/GlobalISel/GISelChangeObserver.h"

Inheritance diagram for llvm::GISelChangeObserver:
[legend]

Public Member Functions

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.
LLVM_ABI void changingAllUsesOfReg (const MachineRegisterInfo &MRI, Register Reg)
 All the instructions using the given register are being changed.
LLVM_ABI void finishedChangingAllUsesOfReg ()
 All instructions reported as changing by changingAllUsesOfReg() have finished being changed.

Detailed Description

Abstract class that contains various methods for clients to notify about changes.

This should be the preferred way for APIs to notify changes. Typically calling erasingInstr/createdInstr multiple times should not affect the result. The observer would likely need to check if it was already notified earlier (consider using GISelWorkList).

Definition at line 30 of file GISelChangeObserver.h.

Constructor & Destructor Documentation

◆ ~GISelChangeObserver()

virtual llvm::GISelChangeObserver::~GISelChangeObserver ( )
virtualdefault

Member Function Documentation

◆ changedInstr()

◆ changingAllUsesOfReg()

void GISelChangeObserver::changingAllUsesOfReg ( const MachineRegisterInfo & MRI,
Register Reg )

All the instructions using the given register are being changed.

For convenience, finishedChangingAllUsesOfReg() will report the completion of the changes. The use list may change between this call and finishedChangingAllUsesOfReg().

Definition at line 18 of file GISelChangeObserver.cpp.

References changingInstr(), and MRI.

Referenced by llvm::GIMatchTableExecutor::executeMatchTable().

◆ changingInstr()

◆ createdInstr()

virtual void llvm::GISelChangeObserver::createdInstr ( MachineInstr & MI)
pure virtual

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.

Implemented in llvm::Combiner::WorkListMaintainerImpl< Lvl >, llvm::GISelCSEInfo, llvm::GISelObserverWrapper, llvm::GISelValueTracking, llvm::InstructionSelect::MIIteratorMaintainer, and llvm::LostDebugLocObserver.

References MI.

◆ erasingInstr()

virtual void llvm::GISelChangeObserver::erasingInstr ( MachineInstr & MI)
pure virtual

◆ finishedChangingAllUsesOfReg()

void GISelChangeObserver::finishedChangingAllUsesOfReg ( )

All instructions reported as changing by changingAllUsesOfReg() have finished being changed.

Definition at line 26 of file GISelChangeObserver.cpp.

References changedInstr().

Referenced by llvm::GIMatchTableExecutor::executeMatchTable().


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