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 tryCombineExtendingLoads (MachineInstr &MI)
 If MI is extend that consumes the result of a load, try to combine it. More...
 
bool tryCombine (MachineInstr &MI)
 Try to transform MI by using all of the above combine functions. More...
 

Detailed Description

Definition at line 29 of file CombinerHelper.h.

Constructor & Destructor Documentation

◆ CombinerHelper()

CombinerHelper::CombinerHelper ( GISelChangeObserver Observer,
MachineIRBuilder B 
)

Definition at line 22 of file CombinerHelper.cpp.

Member Function Documentation

◆ 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 38 of file CombinerHelper.cpp.

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

Referenced by tryCombineExtendingLoads().

◆ 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 331 of file CombinerHelper.cpp.

References tryCombineCopy(), and tryCombineExtendingLoads().

◆ tryCombineCopy()

bool CombinerHelper::tryCombineCopy ( MachineInstr MI)

◆ tryCombineExtendingLoads()

bool CombinerHelper::tryCombineExtendingLoads ( MachineInstr MI)

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