LLVM
8.0.1
|
#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>
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< bool > | DisableHoisting ("disable-spill-hoist", cl::Hidden, cl::desc("Disable inline spill hoisting")) |
#define DEBUG_TYPE "regalloc" |
Definition at line 65 of file InlineSpiller.cpp.
|
static |
Definition at line 717 of file InlineSpiller.cpp.
References llvm::MachineOperandIteratorBase::analyzePhysReg(), assert(), llvm::MachineInstrSpan::begin(), llvm::dbgs(), E, llvm::SmallVectorBase::empty(), llvm::MachineInstrSpan::empty(), llvm::MachineInstr::eraseFromParent(), llvm::LiveIntervals::getInstructionIndex(), llvm::MachineInstr::getNumOperands(), llvm::MachineInstr::getOpcode(), llvm::MachineInstr::getOperand(), llvm::MachineOperand::getReg(), llvm::SlotIndex::getRegSlot(), llvm::MachineOperand::getSubReg(), I, llvm::MachineInstr::isBundled(), llvm::MachineInstr::isCopy(), llvm::MachineOperand::isDef(), llvm::MachineOperand::isEarlyClobber(), llvm::MachineOperand::isImplicit(), llvm::MachineOperand::isReg(), llvm::MachineInstr::isRegTiedToDefOperand(), llvm::HexagonInstrInfo::isStoreToStackSlot(), llvm::MachineOperandIteratorBase::isValid(), llvm::TargetRegisterInfo::isVirtualRegister(), LLVM_DEBUG, llvm::HexagonInstrInfo::loadRegFromStackSlot(), MI, MRI, llvm::SmallVectorTemplateBase< T, bool >::push_back(), llvm::MachineInstr::RemoveOperand(), TII, and TRI.
Referenced by isFullUndefDef().
|
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().
|
static |
Check if Def
fully defines a VReg with an undefined value.
If that's the case, that means the value of VReg is actually not relevant.
Definition at line 888 of file InlineSpiller.cpp.
References Allocator, llvm::MachineOperandIteratorBase::analyzeVirtReg(), assert(), llvm::LiveRange::assign(), llvm::buildDbgValueForSpill(), llvm::BuildMI(), llvm::dbgs(), llvm::VNInfo::def, dumpMachineInstrRangeWithSlotIndex(), E, llvm::MachineBasicBlock::end(), llvm::MachineInstrSpan::end(), llvm::MachineBasicBlock::erase(), llvm::MachineInstr::eraseFromParent(), llvm::getKillRegState(), llvm::MachineInstr::getNumOperands(), llvm::MachineInstr::getOperand(), llvm::LiveRangeEdit::getParent(), llvm::MachineInstr::getParent(), llvm::SlotIndex::getPrevSlot(), llvm::LiveRangeEdit::getReg(), llvm::SlotIndex::getRegSlot(), llvm::MachineOperand::getSubReg(), llvm::LiveRange::getVNInfoAt(), llvm::MachineOperand::isDead(), llvm::MachineInstr::isDebugInstr(), llvm::MachineInstr::isDebugValue(), isFullCopyOf(), llvm::MachineInstr::isImplicitDef(), llvm::SlotIndex::isSameInstr(), llvm::LiveInterval::isSpillable(), llvm::TargetRegisterInfo::isStackSlot(), llvm::MachineOperand::isUse(), llvm::AMDGPUISD::KILL, LLVM_DEBUG, Loops, MRI, llvm::VirtRegMap::NO_STACK_SLOT, llvm::printReg(), llvm::LiveInterval::reg, llvm::MachineOperand::setIsDead(), llvm::MachineOperand::setIsKill(), llvm::MachineOperand::setReg(), llvm::HexagonInstrInfo::storeRegToStackSlot(), TII, TRI, and llvm::LiveInterval::weight.
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" | |||
) |