LLVM  6.0.0svn
Macros | Enumerations | Functions | Variables
MachineCombiner.cpp File Reference
#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/CodeGen/MachineDominators.h"
#include "llvm/CodeGen/MachineFunction.h"
#include "llvm/CodeGen/MachineFunctionPass.h"
#include "llvm/CodeGen/MachineInstrBuilder.h"
#include "llvm/CodeGen/MachineLoopInfo.h"
#include "llvm/CodeGen/MachineRegisterInfo.h"
#include "llvm/CodeGen/MachineTraceMetrics.h"
#include "llvm/CodeGen/Passes.h"
#include "llvm/CodeGen/TargetSchedule.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/raw_ostream.h"
#include "llvm/Target/TargetInstrInfo.h"
#include "llvm/Target/TargetRegisterInfo.h"
#include "llvm/Target/TargetSubtargetInfo.h"
Include dependency graph for MachineCombiner.cpp:

Go to the source code of this file.

Macros

#define DEBUG_TYPE   "machine-combiner"
 

Enumerations

enum  CombinerObjective { CombinerObjective::MustReduceDepth, CombinerObjective::Default }
 The combiner's goal may differ based on which pattern it is attempting to optimize. More...
 

Functions

 STATISTIC (NumInstCombined, "Number of machineinst combined")
 
 INITIALIZE_PASS_BEGIN (MachineCombiner, DEBUG_TYPE, "Machine InstCombiner", false, false) INITIALIZE_PASS_END(MachineCombiner
 
static CombinerObjective getCombinerObjective (MachineCombinerPattern P)
 
static void insertDeleteInstructions (MachineBasicBlock *MBB, MachineInstr &MI, SmallVector< MachineInstr *, 16 > InsInstrs, SmallVector< MachineInstr *, 16 > DelInstrs, MachineTraceMetrics::Ensemble *MinInstr, SparseSet< LiveRegUnit > &RegUnits, bool IncrementalUpdate)
 Inserts InsInstrs and deletes DelInstrs. More...
 

Variables

static cl::opt< unsignedinc_threshold ("machine-combiner-inc-threshold", cl::Hidden, cl::desc("Incremental depth computation will be used for basic " "blocks with more instructions."), cl::init(500))
 
 DEBUG_TYPE
 
Machine InstCombiner
 
Machine false
 

Macro Definition Documentation

◆ DEBUG_TYPE

#define DEBUG_TYPE   "machine-combiner"

Definition at line 34 of file MachineCombiner.cpp.

Enumeration Type Documentation

◆ CombinerObjective

enum CombinerObjective
strong

The combiner's goal may differ based on which pattern it is attempting to optimize.

Enumerator
MustReduceDepth 
Default 

Definition at line 226 of file MachineCombiner.cpp.

Function Documentation

◆ getCombinerObjective()

static CombinerObjective getCombinerObjective ( MachineCombinerPattern  P)
static

◆ INITIALIZE_PASS_BEGIN()

INITIALIZE_PASS_BEGIN ( MachineCombiner  ,
DEBUG_TYPE  ,
"Machine InstCombiner ,
false  ,
false   
)

◆ insertDeleteInstructions()

static void insertDeleteInstructions ( MachineBasicBlock MBB,
MachineInstr MI,
SmallVector< MachineInstr *, 16 >  InsInstrs,
SmallVector< MachineInstr *, 16 >  DelInstrs,
MachineTraceMetrics::Ensemble MinInstr,
SparseSet< LiveRegUnit > &  RegUnits,
bool  IncrementalUpdate 
)
static

Inserts InsInstrs and deletes DelInstrs.

Incrementally updates instruction depths if requested.

Parameters
MBBbasic block to insert instructions in
MIcurrent machine instruction
InsInstrsnew instructions to insert in MBB
DelInstrsinstruction to delete from MBB
MinInstris a pointer to the machine trace information
RegUnitsset of live registers, needed to compute instruction depths
IncrementalUpdateif true, compute instruction depths incrementally, otherwise invalidate the trace

Definition at line 376 of file MachineCombiner.cpp.

References llvm::SparseSet< ValueT, KeyFunctorT, SparseT >::begin(), llvm::MachineBasicBlock::begin(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::clear(), llvm::dbgs(), DEBUG, llvm::MachineFunction::DeleteMachineInstr(), llvm::Pass::dump(), llvm::SparseSet< ValueT, KeyFunctorT, SparseT >::end(), llvm::MachineBasicBlock::end(), llvm::SparseSet< ValueT, KeyFunctorT, SparseT >::erase(), llvm::MachineFunction::getFunction(), llvm::TargetSubtargetInfo::getInstrInfo(), llvm::MachineBasicBlock::getName(), llvm::MachineFunction::getName(), llvm::MachineBasicBlock::getParent(), llvm::MachineFunction::getRegInfo(), llvm::TargetSubtargetInfo::getRegisterInfo(), llvm::MCSubtargetInfo::getSchedModel(), llvm::MachineFunction::getSubtarget(), I, inc_threshold, llvm::MachineBasicBlock::insert(), llvm::MachineTraceMetrics::Ensemble::invalidate(), MI, MRI, llvm::Function::optForSize(), P, llvm::SparseSet< ValueT, KeyFunctorT, SparseT >::setUniverse(), llvm::SmallVectorTemplateCommon< T >::size(), llvm::MachineBasicBlock::size(), TII, llvm::MachineTraceMetrics::TS_MinInstrCount, and llvm::MachineTraceMetrics::Ensemble::updateDepth().

◆ STATISTIC()

STATISTIC ( NumInstCombined  ,
"Number of machineinst combined"   
)

Variable Documentation

◆ DEBUG_TYPE

DEBUG_TYPE

Definition at line 99 of file MachineCombiner.cpp.

◆ false

Machine false

Definition at line 99 of file MachineCombiner.cpp.

◆ inc_threshold

cl::opt<unsigned> inc_threshold("machine-combiner-inc-threshold", cl::Hidden, cl::desc("Incremental depth computation will be used for basic " "blocks with more instructions."), cl::init(500))
static

◆ InstCombiner

Definition at line 99 of file MachineCombiner.cpp.