LLVM  9.0.0svn
Public Member Functions | List of all members
llvm::CombinerHelper Class Reference

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

Public Member Functions

 CombinerHelper (GISelChangeObserver &Observer, MachineIRBuilder &B)
 
void replaceRegWith (MachineRegisterInfo &MRI, unsigned FromReg, unsigned ToReg) const
 MachineRegisterInfo::replaceRegWith() and inform the observer of the changes. More...
 
void replaceRegOpWith (MachineRegisterInfo &MRI, MachineOperand &FromRegOp, unsigned ToReg) const
 Replace a single register operand with a new register and inform the observer of the changes. More...
 
bool tryCombineCopy (MachineInstr &MI)
 If MI is COPY, try to combine it. More...
 
bool matchCombineCopy (MachineInstr &MI)
 
void applyCombineCopy (MachineInstr &MI)
 
bool tryCombineExtendingLoads (MachineInstr &MI)
 If MI is extend that consumes the result of a load, try to combine it. More...
 
bool matchCombineExtendingLoads (MachineInstr &MI, PreferredTuple &MatchInfo)
 
void applyCombineExtendingLoads (MachineInstr &MI, PreferredTuple &MatchInfo)
 
bool tryCombine (MachineInstr &MI)
 Try to transform MI by using all of the above combine functions. More...
 

Detailed Description

Definition at line 36 of file CombinerHelper.h.

Constructor & Destructor Documentation

◆ CombinerHelper()

CombinerHelper::CombinerHelper ( GISelChangeObserver Observer,
MachineIRBuilder B 
)

Definition at line 21 of file CombinerHelper.cpp.

Member Function Documentation

◆ applyCombineCopy()

void CombinerHelper::applyCombineCopy ( MachineInstr MI)

◆ applyCombineExtendingLoads()

void CombinerHelper::applyCombineExtendingLoads ( MachineInstr MI,
PreferredTuple MatchInfo 
)

◆ matchCombineCopy()

bool CombinerHelper::matchCombineCopy ( MachineInstr MI)

◆ matchCombineExtendingLoads()

bool CombinerHelper::matchCombineExtendingLoads ( MachineInstr MI,
PreferredTuple MatchInfo 
)

◆ replaceRegOpWith()

void CombinerHelper::replaceRegOpWith ( MachineRegisterInfo MRI,
MachineOperand FromRegOp,
unsigned  ToReg 
) const

Replace a single register operand with a new register and inform the observer of the changes.

Definition at line 37 of file CombinerHelper.cpp.

References assert(), llvm::GISelChangeObserver::changedInstr(), llvm::GISelChangeObserver::changingInstr(), llvm::MachineOperand::getParent(), and llvm::MachineOperand::setReg().

Referenced by applyCombineExtendingLoads().

◆ replaceRegWith()

void CombinerHelper::replaceRegWith ( MachineRegisterInfo MRI,
unsigned  FromReg,
unsigned  ToReg 
) const

◆ tryCombine()

bool CombinerHelper::tryCombine ( MachineInstr MI)

Try to transform MI by using all of the above combine functions.

Returns true if changed.

Definition at line 345 of file CombinerHelper.cpp.

References tryCombineCopy(), and tryCombineExtendingLoads().

◆ tryCombineCopy()

bool CombinerHelper::tryCombineCopy ( MachineInstr MI)

If MI is COPY, try to combine it.

Returns true if MI changed.

Definition at line 48 of file CombinerHelper.cpp.

References applyCombineCopy(), and matchCombineCopy().

Referenced by tryCombine().

◆ tryCombineExtendingLoads()

bool CombinerHelper::tryCombineExtendingLoads ( MachineInstr MI)

If MI is extend that consumes the result of a load, try to combine it.

Returns true if MI changed.

Definition at line 160 of file CombinerHelper.cpp.

References applyCombineExtendingLoads(), and matchCombineExtendingLoads().

Referenced by tryCombine().


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