LLVM
8.0.1
|
Abstract class that contains various methods for clients to notify about changes. More...
#include "llvm/CodeGen/GlobalISel/GISelChangeObserver.h"
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... | |
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.
|
inlinevirtual |
Definition at line 33 of file GISelChangeObserver.h.
References changedInstr(), changingAllUsesOfReg(), changingInstr(), createdInstr(), erasingInstr(), finishedChangingAllUsesOfReg(), MI, MRI, and Reg.
|
pure virtual |
This instruction was mutated in some way.
Implemented in llvm::GISelCSEInfo, and llvm::GISelObserverWrapper.
Referenced by finishedChangingAllUsesOfReg(), llvm::CombinerHelper::replaceRegOpWith(), llvm::LegalizerHelper::widenScalar(), and ~GISelChangeObserver().
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().
|
pure virtual |
This instruction is about to be mutated in some way.
Implemented in llvm::GISelCSEInfo, and llvm::GISelObserverWrapper.
Referenced by changingAllUsesOfReg(), llvm::CombinerHelper::replaceRegOpWith(), llvm::LegalizerHelper::widenScalar(), and ~GISelChangeObserver().
|
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().
|
pure virtual |
An instruction is about to be erased.
Implemented in llvm::GISelCSEInfo, and llvm::GISelObserverWrapper.
Referenced by llvm::GISelObserverWrapper::MF_HandleRemoval(), and ~GISelChangeObserver().
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().