LLVM 20.0.0git
Public Types | Public Member Functions | Public Attributes | List of all members
llvm::CombinerInfo Struct Reference

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

Public Types

enum class  ObserverLevel { Basic , DCE , SinglePass }
 

Public Member Functions

 CombinerInfo (bool AllowIllegalOps, bool ShouldLegalizeIllegal, const LegalizerInfo *LInfo, bool OptEnabled, bool OptSize, bool MinSize)
 
virtual ~CombinerInfo ()=default
 

Public Attributes

bool IllegalOpsAllowed
 If IllegalOpsAllowed is false, the CombinerHelper will make use of the legalizerInfo to check for legality before each transformation.
 
bool LegalizeIllegalOps
 If LegalizeIllegalOps is true, the Combiner will also legalize the illegal ops that are created.
 
const LegalizerInfoLInfo
 
bool EnableOpt
 Whether optimizations should be enabled.
 
bool EnableOptSize
 Whether we're optimizing for size.
 
bool EnableMinSize
 Whether we're optimizing for minsize (-Oz).
 
unsigned MaxIterations = 0
 The maximum number of times the Combiner will iterate over the MachineFunction.
 
ObserverLevel ObserverLvl = ObserverLevel::Basic
 Select how the Combiner acts on MIR changes.
 
bool EnableFullDCE = true
 Whether dead code elimination is performed before each Combiner iteration.
 

Detailed Description

Definition at line 24 of file CombinerInfo.h.

Member Enumeration Documentation

◆ ObserverLevel

Enumerator
Basic 

Only retry combining created/changed instructions.

This replicates the legacy default Observer behavior for use with fixed-point iteration.

DCE 

Enables Observer-based detection of dead instructions.

This can save some compile-time if full disabling of fixed-point iteration is not desired. If the input IR doesn't contain dead instructions, consider disabling EnableFullDCE.

SinglePass 

Enables Observer-based DCE and additional heuristics that retry combining defined and used instructions of modified instructions.

This provides a good balance between compile-time and completeness of combining without needing fixed-point iteration.

Definition at line 57 of file CombinerInfo.h.

Constructor & Destructor Documentation

◆ CombinerInfo()

llvm::CombinerInfo::CombinerInfo ( bool  AllowIllegalOps,
bool  ShouldLegalizeIllegal,
const LegalizerInfo LInfo,
bool  OptEnabled,
bool  OptSize,
bool  MinSize 
)
inline

Definition at line 25 of file CombinerInfo.h.

References assert(), LegalizeIllegalOps, and LInfo.

◆ ~CombinerInfo()

virtual llvm::CombinerInfo::~CombinerInfo ( )
virtualdefault

Member Data Documentation

◆ EnableFullDCE

bool llvm::CombinerInfo::EnableFullDCE = true

Whether dead code elimination is performed before each Combiner iteration.

If Observer-based DCE is enabled, this controls if a full DCE pass is performed before the first Combiner iteration.

Definition at line 80 of file CombinerInfo.h.

Referenced by llvm::Combiner::combineMachineInstrs().

◆ EnableMinSize

bool llvm::CombinerInfo::EnableMinSize

Whether we're optimizing for minsize (-Oz).

Definition at line 51 of file CombinerInfo.h.

◆ EnableOpt

bool llvm::CombinerInfo::EnableOpt

Whether optimizations should be enabled.

This is to distinguish between uses of the combiner unconditionally and only when optimizations are specifically enabled/

Definition at line 47 of file CombinerInfo.h.

◆ EnableOptSize

bool llvm::CombinerInfo::EnableOptSize

Whether we're optimizing for size.

Definition at line 49 of file CombinerInfo.h.

◆ IllegalOpsAllowed

bool llvm::CombinerInfo::IllegalOpsAllowed

If IllegalOpsAllowed is false, the CombinerHelper will make use of the legalizerInfo to check for legality before each transformation.

Definition at line 37 of file CombinerInfo.h.

◆ LegalizeIllegalOps

bool llvm::CombinerInfo::LegalizeIllegalOps

If LegalizeIllegalOps is true, the Combiner will also legalize the illegal ops that are created.

Definition at line 41 of file CombinerInfo.h.

Referenced by CombinerInfo().

◆ LInfo

const LegalizerInfo* llvm::CombinerInfo::LInfo

Definition at line 42 of file CombinerInfo.h.

Referenced by CombinerInfo().

◆ MaxIterations

unsigned llvm::CombinerInfo::MaxIterations = 0

The maximum number of times the Combiner will iterate over the MachineFunction.

Setting this to 0 enables fixed-point iteration.

Definition at line 55 of file CombinerInfo.h.

Referenced by llvm::Combiner::combineMachineInstrs().

◆ ObserverLvl

ObserverLevel llvm::CombinerInfo::ObserverLvl = ObserverLevel::Basic

Select how the Combiner acts on MIR changes.

Definition at line 75 of file CombinerInfo.h.

Referenced by llvm::Combiner::combineMachineInstrs().


The documentation for this struct was generated from the following file: