LLVM  8.0.1
Public Member Functions | List of all members
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:
Inheritance graph
[legend]

Public Member Functions

virtual ~GISelChangeObserver ()
 
virtual void erasingInstr (MachineInstr &MI)=0
 An instruction is about to be erased. More...
 
virtual void createdInstr (MachineInstr &MI)=0
 An instruction was created and inserted into the function. More...
 
virtual void changingInstr (MachineInstr &MI)=0
 This instruction is about to be mutated in some way. More...
 
virtual void changedInstr (MachineInstr &MI)=0
 This instruction was mutated in some way. More...
 
void changingAllUsesOfReg (const MachineRegisterInfo &MRI, unsigned Reg)
 All the instructions using the given register are being changed. More...
 
void finishedChangingAllUsesOfReg ()
 All instructions reported as changing by changingAllUsesOfReg() have finished being changed. More...
 

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 29 of file GISelChangeObserver.h.

Constructor & Destructor Documentation

◆ ~GISelChangeObserver()

virtual llvm::GISelChangeObserver::~GISelChangeObserver ( )
inlinevirtual

Member Function Documentation

◆ changedInstr()

virtual void llvm::GISelChangeObserver::changedInstr ( MachineInstr MI)
pure virtual

◆ changingAllUsesOfReg()

void GISelChangeObserver::changingAllUsesOfReg ( const MachineRegisterInfo MRI,
unsigned  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 19 of file GISelChangeObserver.cpp.

References changingInstr(), and llvm::MachineRegisterInfo::use_instructions().

Referenced by llvm::CombinerHelper::replaceRegWith(), and ~GISelChangeObserver().

◆ changingInstr()

virtual void llvm::GISelChangeObserver::changingInstr ( MachineInstr MI)
pure virtual

◆ createdInstr()

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

An instruction was created and inserted into the function.

Implemented in llvm::GISelCSEInfo, and llvm::GISelObserverWrapper.

Referenced by llvm::GISelObserverWrapper::MF_HandleInsertion(), llvm::MachineIRBuilder::recordInsertion(), and ~GISelChangeObserver().

◆ erasingInstr()

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

An instruction is about to be erased.

Implemented in llvm::GISelCSEInfo, and llvm::GISelObserverWrapper.

Referenced by llvm::GISelObserverWrapper::MF_HandleRemoval(), and ~GISelChangeObserver().

◆ finishedChangingAllUsesOfReg()

void GISelChangeObserver::finishedChangingAllUsesOfReg ( )

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

Definition at line 27 of file GISelChangeObserver.cpp.

References changedInstr().

Referenced by llvm::CombinerHelper::replaceRegWith(), and ~GISelChangeObserver().


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