LLVM  6.0.0svn
Classes | Namespaces | Macros | Typedefs | Functions | Variables
MachineTraceMetrics.cpp File Reference
#include "llvm/CodeGen/MachineTraceMetrics.h"
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/Optional.h"
#include "llvm/ADT/PostOrderIterator.h"
#include "llvm/ADT/SmallPtrSet.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/SparseSet.h"
#include "llvm/CodeGen/MachineBasicBlock.h"
#include "llvm/CodeGen/MachineBranchProbabilityInfo.h"
#include "llvm/CodeGen/MachineFunction.h"
#include "llvm/CodeGen/MachineInstr.h"
#include "llvm/CodeGen/MachineLoopInfo.h"
#include "llvm/CodeGen/MachineOperand.h"
#include "llvm/CodeGen/MachineRegisterInfo.h"
#include "llvm/CodeGen/TargetSchedule.h"
#include "llvm/MC/MCRegisterInfo.h"
#include "llvm/Pass.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/Format.h"
#include "llvm/Support/raw_ostream.h"
#include "llvm/Target/TargetRegisterInfo.h"
#include "llvm/Target/TargetSubtargetInfo.h"
#include <algorithm>
#include <cassert>
#include <iterator>
#include <tuple>
#include <utility>
Include dependency graph for MachineTraceMetrics.cpp:

Go to the source code of this file.

Classes

class  llvm::po_iterator_storage< LoopBounds, true >
 

Namespaces

 llvm
 Compute iterated dominance frontiers using a linear time algorithm.
 

Macros

#define DEBUG_TYPE   "machine-trace-metrics"
 

Typedefs

using MIHeightMap = DenseMap< const MachineInstr *, unsigned >
 

Functions

 INITIALIZE_PASS_BEGIN (MachineTraceMetrics, DEBUG_TYPE, "Machine Trace Metrics", false, true) INITIALIZE_PASS_END(MachineTraceMetrics
 
static bool isExitingLoop (const MachineLoop *From, const MachineLoop *To)
 
static bool getDataDeps (const MachineInstr &UseMI, SmallVectorImpl< DataDep > &Deps, const MachineRegisterInfo *MRI)
 
static void getPHIDeps (const MachineInstr &UseMI, SmallVectorImpl< DataDep > &Deps, const MachineBasicBlock *Pred, const MachineRegisterInfo *MRI)
 
static void updatePhysDepsDownwards (const MachineInstr *UseMI, SmallVectorImpl< DataDep > &Deps, SparseSet< LiveRegUnit > &RegUnits, const TargetRegisterInfo *TRI)
 
static unsigned updatePhysDepsUpwards (const MachineInstr &MI, unsigned Height, SparseSet< LiveRegUnit > &RegUnits, const TargetSchedModel &SchedModel, const TargetInstrInfo *TII, const TargetRegisterInfo *TRI)
 
static bool pushDepHeight (const DataDep &Dep, const MachineInstr &UseMI, unsigned UseHeight, MIHeightMap &Heights, const TargetSchedModel &SchedModel, const TargetInstrInfo *TII)
 

Variables

 DEBUG_TYPE
 
Machine Trace Metrics
 
Machine Trace false
 

Macro Definition Documentation

◆ DEBUG_TYPE

#define DEBUG_TYPE   "machine-trace-metrics"

Definition at line 42 of file MachineTraceMetrics.cpp.

Typedef Documentation

◆ MIHeightMap

Definition at line 949 of file MachineTraceMetrics.cpp.

Function Documentation

◆ getDataDeps()

static bool getDataDeps ( const MachineInstr UseMI,
SmallVectorImpl< DataDep > &  Deps,
const MachineRegisterInfo MRI 
)
static

◆ getPHIDeps()

static void getPHIDeps ( const MachineInstr UseMI,
SmallVectorImpl< DataDep > &  Deps,
const MachineBasicBlock Pred,
const MachineRegisterInfo MRI 
)
static

◆ INITIALIZE_PASS_BEGIN()

INITIALIZE_PASS_BEGIN ( MachineTraceMetrics  ,
DEBUG_TYPE  ,
"Machine Trace Metrics ,
false  ,
true   
)

◆ isExitingLoop()

static bool isExitingLoop ( const MachineLoop From,
const MachineLoop To 
)
static

◆ pushDepHeight()

static bool pushDepHeight ( const DataDep &  Dep,
const MachineInstr UseMI,
unsigned  UseHeight,
MIHeightMap Heights,
const TargetSchedModel SchedModel,
const TargetInstrInfo TII 
)
static

Definition at line 953 of file MachineTraceMetrics.cpp.

References llvm::addLiveIns(), assert(), llvm::SmallVectorTemplateCommon< T >::back(), llvm::SparseSet< ValueT, KeyFunctorT, SparseT >::begin(), llvm::MachineBasicBlock::begin(), llvm::SmallVectorImpl< T >::clear(), llvm::TargetSchedModel::computeOperandLatency(), llvm::dbgs(), DEBUG, DefMI, llvm::SmallVectorBase::empty(), llvm::ArrayRef< T >::empty(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::end(), llvm::SparseSet< ValueT, KeyFunctorT, SparseT >::end(), llvm::MachineBasicBlock::end(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::erase(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::find(), llvm::format(), llvm::SmallVectorTemplateCommon< T >::front(), getDataDeps(), llvm::LoopBase< BlockT, LoopT >::getHeader(), llvm::MachineTraceMetrics::Ensemble::getLoopFor(), llvm::MachineBasicBlock::getNumber(), llvm::MCRegisterInfo::getNumRegUnits(), llvm::MachineInstr::getOperand(), llvm::MachineInstr::getParent(), getPHIDeps(), llvm::TargetSchedModel::getProcResource(), llvm::MachineTraceMetrics::Ensemble::getProcResourceHeights(), llvm::MachineOperand::getReg(), llvm::TargetSchedModel::getResourceFactor(), llvm::MachineRegisterInfo::getVRegDef(), I, llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::insert(), llvm::MachineInstr::isPHI(), llvm::MachineBasicBlock::isSuccessor(), llvm::TargetRegisterInfo::isVirtualRegister(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::lookup(), llvm::max(), MI, llvm::MachineTraceMetrics::Ensemble::MTM, llvm::MCProcResourceDesc::Name, llvm::SmallVectorTemplateBase< T, isPodLike< T >::value >::pop_back(), llvm::PrintReg(), llvm::PrintRegUnit(), llvm::SmallVectorTemplateBase< T, isPodLike< T >::value >::push_back(), llvm::SparseSet< ValueT, KeyFunctorT, SparseT >::setUniverse(), llvm::ArrayRef< T >::size(), and updatePhysDepsUpwards().

◆ updatePhysDepsDownwards()

static void updatePhysDepsDownwards ( const MachineInstr UseMI,
SmallVectorImpl< DataDep > &  Deps,
SparseSet< LiveRegUnit > &  RegUnits,
const TargetRegisterInfo TRI 
)
static

◆ updatePhysDepsUpwards()

static unsigned updatePhysDepsUpwards ( const MachineInstr MI,
unsigned  Height,
SparseSet< LiveRegUnit > &  RegUnits,
const TargetSchedModel SchedModel,
const TargetInstrInfo TII,
const TargetRegisterInfo TRI 
)
static

Variable Documentation

◆ DEBUG_TYPE

DEBUG_TYPE

Definition at line 52 of file MachineTraceMetrics.cpp.

◆ false

Machine Trace false

Definition at line 52 of file MachineTraceMetrics.cpp.

◆ Metrics

Machine Trace Metrics