LLVM 20.0.0git
|
Abstract class that contains various methods for clients to notify about changes. More...
#include "llvm/CodeGen/GlobalISel/GISelChangeObserver.h"
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. | |
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. | |
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.
|
virtualdefault |
|
pure virtual |
This instruction was mutated in some way.
Implemented in llvm::GISelCSEInfo, llvm::GISelObserverWrapper, llvm::GISelKnownBits, llvm::LostDebugLocObserver, and llvm::Combiner::WorkListMaintainerImpl< Lvl >.
Referenced by llvm::CombinerHelper::applyCombineExtendingLoads(), llvm::CombinerHelper::applyCombineMulToShl(), llvm::CombinerHelper::applyCommuteBinOpOperands(), llvm::CombinerHelper::applyFunnelShiftToRotate(), llvm::CombinerHelper::applyNotCmp(), llvm::CombinerHelper::applyOptBrCondByInvertingCond(), llvm::CombinerHelper::applyPtrAddImmedChain(), llvm::CombinerHelper::applyRotateOutOfRange(), llvm::CombinerHelper::applyShiftImmedChain(), llvm::CombinerHelper::applyXorOfAndWithSameReg(), llvm::LegalizerHelper::bitcast(), llvm::GIMatchTableExecutor::executeMatchTable(), finishedChangingAllUsesOfReg(), llvm::AMDGPULegalizerInfo::legalizeImageIntrinsic(), llvm::AArch64LegalizerInfo::legalizeIntrinsic(), llvm::AMDGPULegalizerInfo::legalizeIntrinsic(), llvm::AMDGPULegalizerInfo::legalizeLoad(), llvm::AMDGPULegalizerInfo::legalizeSBufferLoad(), llvm::AMDGPULegalizerInfo::legalizeStore(), llvm::LegalizerHelper::lower(), llvm::LegalizerHelper::lowerBitCount(), llvm::LegalizerHelper::lowerVectorReduction(), llvm::CombinerHelper::matchAddEToAddO(), llvm::CombinerHelper::matchAndOrDisjointMask(), llvm::CombinerHelper::matchFreezeOfSingleMaybePoisonOperand(), llvm::CombinerHelper::matchMulOBy2(), llvm::CombinerHelper::matchNarrowBinopFeedingAnd(), llvm::CombinerHelper::matchReassocConstantInnerLHS(), llvm::CombinerHelper::matchReassocConstantInnerRHS(), llvm::CombinerHelper::matchReassocFoldConstantsInSubTree(), llvm::CombinerHelper::matchRedundantNegOperands(), llvm::LegalizerHelper::moreElementsVector(), llvm::LegalizerHelper::moreElementsVectorPhi(), llvm::LegalizerHelper::narrowScalar(), llvm::LegalizerHelper::narrowScalarFLDEXP(), llvm::LegalizerHelper::narrowScalarFPTOI(), llvm::LegalizerHelper::narrowScalarShift(), llvm::CombinerHelper::replaceOpcodeWith(), llvm::CombinerHelper::replaceRegOpWith(), llvm::LegalizationArtifactCombiner::replaceRegOrBuildCopy(), llvm::LegalizationArtifactCombiner::ArtifactValueFinder::tryCombineUnmergeDefs(), and llvm::LegalizerHelper::widenScalar().
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(), and llvm::CombinerHelper::replaceRegWith().
|
pure virtual |
This instruction is about to be mutated in some way.
Implemented in llvm::GISelCSEInfo, llvm::GISelObserverWrapper, llvm::GISelKnownBits, llvm::LostDebugLocObserver, and llvm::Combiner::WorkListMaintainerImpl< Lvl >.
Referenced by llvm::CombinerHelper::applyCombineExtendingLoads(), llvm::CombinerHelper::applyCombineMulToShl(), llvm::CombinerHelper::applyCommuteBinOpOperands(), llvm::CombinerHelper::applyFunnelShiftToRotate(), llvm::CombinerHelper::applyNotCmp(), llvm::CombinerHelper::applyOptBrCondByInvertingCond(), llvm::CombinerHelper::applyPtrAddImmedChain(), llvm::CombinerHelper::applyRotateOutOfRange(), llvm::CombinerHelper::applyShiftImmedChain(), llvm::CombinerHelper::applyXorOfAndWithSameReg(), llvm::LegalizerHelper::bitcast(), changingAllUsesOfReg(), llvm::GIMatchTableExecutor::executeMatchTable(), llvm::AMDGPULegalizerInfo::legalizeImageIntrinsic(), llvm::AArch64LegalizerInfo::legalizeIntrinsic(), llvm::AMDGPULegalizerInfo::legalizeIntrinsic(), llvm::AMDGPULegalizerInfo::legalizeLoad(), llvm::AMDGPULegalizerInfo::legalizeSBufferLoad(), llvm::AMDGPULegalizerInfo::legalizeStore(), llvm::LegalizerHelper::lower(), llvm::LegalizerHelper::lowerBitCount(), llvm::LegalizerHelper::lowerVectorReduction(), llvm::CombinerHelper::matchAddEToAddO(), llvm::CombinerHelper::matchAndOrDisjointMask(), llvm::CombinerHelper::matchFreezeOfSingleMaybePoisonOperand(), llvm::CombinerHelper::matchMulOBy2(), llvm::CombinerHelper::matchNarrowBinopFeedingAnd(), llvm::CombinerHelper::matchReassocConstantInnerLHS(), llvm::CombinerHelper::matchReassocConstantInnerRHS(), llvm::CombinerHelper::matchReassocFoldConstantsInSubTree(), llvm::CombinerHelper::matchRedundantNegOperands(), llvm::LegalizerHelper::moreElementsVector(), llvm::LegalizerHelper::moreElementsVectorPhi(), llvm::LegalizerHelper::narrowScalar(), llvm::LegalizerHelper::narrowScalarFLDEXP(), llvm::LegalizerHelper::narrowScalarFPTOI(), llvm::LegalizerHelper::narrowScalarShift(), llvm::CombinerHelper::replaceOpcodeWith(), llvm::CombinerHelper::replaceRegOpWith(), llvm::LegalizationArtifactCombiner::replaceRegOrBuildCopy(), llvm::LegalizationArtifactCombiner::ArtifactValueFinder::tryCombineUnmergeDefs(), and llvm::LegalizerHelper::widenScalar().
|
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::GISelCSEInfo, llvm::GISelObserverWrapper, llvm::GISelKnownBits, llvm::LostDebugLocObserver, and llvm::Combiner::WorkListMaintainerImpl< Lvl >.
Referenced by llvm::MachineIRBuilder::recordInsertion().
|
pure virtual |
An instruction is about to be erased.
Implemented in llvm::GISelCSEInfo, llvm::GISelObserverWrapper, llvm::GISelKnownBits, llvm::LostDebugLocObserver, and llvm::Combiner::WorkListMaintainerImpl< Lvl >.
Referenced by llvm::CombinerHelper::applyCombineExtendingLoads(), and llvm::GIMatchTableExecutor::executeMatchTable().
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(), and llvm::CombinerHelper::replaceRegWith().