LLVM  8.0.1
Macros | Functions | Variables
InlineSpiller.cpp File Reference
#include "LiveRangeCalc.h"
#include "Spiller.h"
#include "SplitKit.h"
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/MapVector.h"
#include "llvm/ADT/None.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/SetVector.h"
#include "llvm/ADT/SmallPtrSet.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/Analysis/AliasAnalysis.h"
#include "llvm/CodeGen/LiveInterval.h"
#include "llvm/CodeGen/LiveIntervals.h"
#include "llvm/CodeGen/LiveRangeEdit.h"
#include "llvm/CodeGen/LiveStacks.h"
#include "llvm/CodeGen/MachineBasicBlock.h"
#include "llvm/CodeGen/MachineBlockFrequencyInfo.h"
#include "llvm/CodeGen/MachineDominators.h"
#include "llvm/CodeGen/MachineFunction.h"
#include "llvm/CodeGen/MachineFunctionPass.h"
#include "llvm/CodeGen/MachineInstr.h"
#include "llvm/CodeGen/MachineInstrBuilder.h"
#include "llvm/CodeGen/MachineInstrBundle.h"
#include "llvm/CodeGen/MachineLoopInfo.h"
#include "llvm/CodeGen/MachineOperand.h"
#include "llvm/CodeGen/MachineRegisterInfo.h"
#include "llvm/CodeGen/SlotIndexes.h"
#include "llvm/CodeGen/TargetInstrInfo.h"
#include "llvm/CodeGen/TargetOpcodes.h"
#include "llvm/CodeGen/TargetRegisterInfo.h"
#include "llvm/CodeGen/TargetSubtargetInfo.h"
#include "llvm/CodeGen/VirtRegMap.h"
#include "llvm/Config/llvm-config.h"
#include "llvm/Support/BlockFrequency.h"
#include "llvm/Support/BranchProbability.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/Compiler.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/raw_ostream.h"
#include <cassert>
#include <iterator>
#include <tuple>
#include <utility>
#include <vector>
Include dependency graph for InlineSpiller.cpp:

Go to the source code of this file.

Macros

#define DEBUG_TYPE   "regalloc"
 

Functions

 STATISTIC (NumSpilledRanges, "Number of spilled live ranges")
 
 STATISTIC (NumSnippets, "Number of spilled snippets")
 
 STATISTIC (NumSpills, "Number of spills inserted")
 
 STATISTIC (NumSpillsRemoved, "Number of spills removed")
 
 STATISTIC (NumReloads, "Number of reloads inserted")
 
 STATISTIC (NumReloadsRemoved, "Number of reloads removed")
 
 STATISTIC (NumFolded, "Number of folded stack accesses")
 
 STATISTIC (NumFoldedLoads, "Number of folded loads")
 
 STATISTIC (NumRemats, "Number of rematerialized defs for spilling")
 
static unsigned isFullCopyOf (const MachineInstr &MI, unsigned Reg)
 isFullCopyOf - If MI is a COPY to or from Reg, return the other register, otherwise return 0. More...
 
static LLVM_DUMP_METHOD void dumpMachineInstrRangeWithSlotIndex (MachineBasicBlock::iterator B, MachineBasicBlock::iterator E, LiveIntervals const &LIS, const char *const header, unsigned VReg=0)
 
static bool isFullUndefDef (const MachineInstr &Def)
 Check if Def fully defines a VReg with an undefined value. More...
 

Variables

static cl::opt< boolDisableHoisting ("disable-spill-hoist", cl::Hidden, cl::desc("Disable inline spill hoisting"))
 

Macro Definition Documentation

◆ DEBUG_TYPE

#define DEBUG_TYPE   "regalloc"

Definition at line 65 of file InlineSpiller.cpp.

Function Documentation

◆ dumpMachineInstrRangeWithSlotIndex()

static LLVM_DUMP_METHOD void dumpMachineInstrRangeWithSlotIndex ( MachineBasicBlock::iterator  B,
MachineBasicBlock::iterator  E,
LiveIntervals const LIS,
const char *const  header,
unsigned  VReg = 0 
)
static

◆ isFullCopyOf()

static unsigned isFullCopyOf ( const MachineInstr MI,
unsigned  Reg 
)
static

isFullCopyOf - If MI is a COPY to or from Reg, return the other register, otherwise return 0.

Definition at line 257 of file InlineSpiller.cpp.

References llvm::MachineInstr::addRegisterDead(), llvm::MachineInstr::allDefsAreDead(), llvm::MachineOperandIteratorBase::analyzeVirtReg(), assert(), llvm::MachineBasicBlock::begin(), llvm::MachineInstr::canFoldAsLoad(), llvm::dbgs(), llvm::VNInfo::def, DefMI, E, llvm::SmallVectorBase::empty(), llvm::MachineInstr::eraseFromParent(), llvm::SlotIndex::getBaseIndex(), llvm::MachineInstr::getDebugLoc(), llvm::MachineInstr::getNumOperands(), llvm::LiveRange::getNumValNums(), llvm::MachineInstr::getOperand(), llvm::MachineInstr::getParent(), llvm::MachineOperand::getReg(), llvm::SlotIndex::getRegSlot(), llvm::LiveRange::getVNInfoAt(), llvm::LiveRange::getVNInfoBefore(), I, llvm::VNInfo::id, llvm::MachineInstr::isCopy(), llvm::MachineInstr::isDebugInstr(), llvm::MachineInstr::isDebugValue(), llvm::MachineInstr::isFullCopy(), llvm::LiveQueryResult::isKill(), llvm::HexagonInstrInfo::isLoadFromStackSlot(), llvm::VNInfo::isPHIDef(), llvm::MachineOperand::isReg(), llvm::HexagonInstrInfo::isStoreToStackSlot(), llvm::VNInfo::isUnused(), llvm::MachineOperand::isUse(), llvm::TargetRegisterInfo::isVirtualRegister(), llvm::AMDGPUISD::KILL, LLVM_DEBUG, LLVM_DUMP_METHOD, llvm::MachineInstr::mayStore(), MI, MRI, llvm::LiveRangeEdit::Remat::OrigMI, P, llvm::LiveRangeEdit::Remat::ParentVNI, llvm::SmallVectorImpl< T >::pop_back_val(), llvm::MachineBasicBlock::predecessors(), llvm::SmallVectorTemplateBase< T >::push_back(), llvm::LiveRange::Query(), llvm::LiveInterval::reg, Reg, llvm::NVPTX::PTXCvtMode::RM, llvm::MachineInstr::setDesc(), llvm::MachineOperand::setIsKill(), llvm::MachineOperand::setIsUndef(), llvm::MachineOperand::setReg(), llvm::MachineBasicBlock::SkipPHIsLabelsAndDebug(), llvm::HexagonInstrInfo::storeRegToStackSlot(), TII, TRI, UseMI, llvm::LiveRange::vni_begin(), and llvm::LiveRange::vni_end().

Referenced by isFullUndefDef().

◆ isFullUndefDef()

static bool isFullUndefDef ( const MachineInstr Def)
static

◆ STATISTIC() [1/9]

STATISTIC ( NumSpilledRanges  ,
"Number of spilled live ranges"   
)

◆ STATISTIC() [2/9]

STATISTIC ( NumSnippets  ,
"Number of spilled snippets"   
)

◆ STATISTIC() [3/9]

STATISTIC ( NumSpills  ,
"Number of spills inserted"   
)

◆ STATISTIC() [4/9]

STATISTIC ( NumSpillsRemoved  ,
"Number of spills removed"   
)

◆ STATISTIC() [5/9]

STATISTIC ( NumReloads  ,
"Number of reloads inserted"   
)

◆ STATISTIC() [6/9]

STATISTIC ( NumReloadsRemoved  ,
"Number of reloads removed"   
)

◆ STATISTIC() [7/9]

STATISTIC ( NumFolded  ,
"Number of folded stack accesses"   
)

◆ STATISTIC() [8/9]

STATISTIC ( NumFoldedLoads  ,
"Number of folded loads"   
)

◆ STATISTIC() [9/9]

STATISTIC ( NumRemats  ,
"Number of rematerialized defs for spilling"   
)

Variable Documentation

◆ DisableHoisting

cl::opt<bool> DisableHoisting("disable-spill-hoist", cl::Hidden, cl::desc("Disable inline spill hoisting"))
static