|
LLVM 22.0.0git
|
#include "llvm/CodeGen/LiveDebugVariables.h"#include "llvm/ADT/ArrayRef.h"#include "llvm/ADT/DenseMap.h"#include "llvm/ADT/IntervalMap.h"#include "llvm/ADT/MapVector.h"#include "llvm/ADT/STLExtras.h"#include "llvm/ADT/SmallSet.h"#include "llvm/ADT/SmallVector.h"#include "llvm/ADT/Statistic.h"#include "llvm/ADT/StringRef.h"#include "llvm/BinaryFormat/Dwarf.h"#include "llvm/CodeGen/LexicalScopes.h"#include "llvm/CodeGen/LiveInterval.h"#include "llvm/CodeGen/LiveIntervals.h"#include "llvm/CodeGen/MachineBasicBlock.h"#include "llvm/CodeGen/MachineDominators.h"#include "llvm/CodeGen/MachineFunction.h"#include "llvm/CodeGen/MachineInstr.h"#include "llvm/CodeGen/MachineInstrBuilder.h"#include "llvm/CodeGen/MachineOperand.h"#include "llvm/CodeGen/MachinePassManager.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/IR/DebugInfoMetadata.h"#include "llvm/IR/DebugLoc.h"#include "llvm/IR/Function.h"#include "llvm/InitializePasses.h"#include "llvm/Pass.h"#include "llvm/Support/Casting.h"#include "llvm/Support/CommandLine.h"#include "llvm/Support/Debug.h"#include "llvm/Support/raw_ostream.h"#include <algorithm>#include <cassert>#include <iterator>#include <map>#include <memory>#include <optional>#include <utility>Go to the source code of this file.
Classes | |
| class | llvm::LiveDebugVariables::LDVImpl |
Namespaces | |
| namespace | llvm |
| This is an optimization pass for GlobalISel generic memory operations. | |
Macros | |
| #define | DEBUG_TYPE "livedebugvars" |
Typedefs | |
| using | LocMap = IntervalMap<SlotIndex, DbgVariableValue, 4> |
| Map of where a user value is live to that value. | |
| using | SpillOffsetMap = DenseMap<unsigned, unsigned> |
| Map of stack slot offsets for spilled locations. | |
| using | BlockSkipInstsMap |
| Cache to save the location where it can be used as the starting position as input for calling MachineBasicBlock::SkipPHIsLabelsAndDebug. | |
Enumerations | |
| enum | : unsigned { UndefLocNo = ~0U } |
Variables | |
| static cl::opt< bool > | EnableLDV ("live-debug-variables", cl::init(true), cl::desc("Enable the live debug variables pass"), cl::Hidden) |
| DEBUG_TYPE | |
| Debug Variable | Analysis |
| Debug Variable | false |
| #define DEBUG_TYPE "livedebugvars" |
Definition at line 69 of file LiveDebugVariables.cpp.
| using BlockSkipInstsMap |
Cache to save the location where it can be used as the starting position as input for calling MachineBasicBlock::SkipPHIsLabelsAndDebug.
This is to prevent MachineBasicBlock::SkipPHIsLabelsAndDebug from repeatedly searching the same set of PHIs/Labels/Debug instructions if it is called many times for the same block.
Definition at line 276 of file LiveDebugVariables.cpp.
| using LocMap = IntervalMap<SlotIndex, DbgVariableValue, 4> |
Map of where a user value is live to that value.
Definition at line 265 of file LiveDebugVariables.cpp.
| using SpillOffsetMap = DenseMap<unsigned, unsigned> |
Map of stack slot offsets for spilled locations.
Non-spilled locations are not added to the map.
Definition at line 269 of file LiveDebugVariables.cpp.
| anonymous enum : unsigned |
| Enumerator | |
|---|---|
| UndefLocNo | |
Definition at line 101 of file LiveDebugVariables.cpp.
|
static |
Find an iterator for inserting a DBG_VALUE instruction.
Definition at line 1636 of file LiveDebugVariables.cpp.
References llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::end(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::find(), llvm::SlotIndex::getBaseIndex(), llvm::LiveIntervals::getInstructionFromIndex(), llvm::LiveIntervals::getMBBStartIdx(), llvm::SlotIndex::getPrevIndex(), I, MBB, MI, and llvm::skipDebugInstructionsForward().
Referenced by llvm::LiveDebugVariables::LDVImpl::emitDebugValues().
|
static |
Find an iterator for inserting the next DBG_VALUE instruction (or end if no more insert locations found).
Definition at line 1683 of file LiveDebugVariables.cpp.
References llvm::any_of(), llvm::SmallVectorTemplateCommon< T, typename >::empty(), llvm::LiveIntervals::getInstructionIndex(), llvm::MachineOperand::getReg(), I, llvm::SlotIndex::isEarlierEqualInstr(), llvm::LiveIntervals::isNotInMIMap(), llvm::MachineOperand::isReg(), MBB, llvm::SmallVectorTemplateBase< T, bool >::push_back(), Reg, and TRI.
| INITIALIZE_PASS_BEGIN | ( | LiveDebugVariablesWrapperLegacy | , |
| DEBUG_TYPE | , | ||
| "Debug Variable Analysis" | , | ||
| false | , | ||
| false | ) |
References DEBUG_TYPE, and INITIALIZE_PASS_DEPENDENCY.
|
static |
Definition at line 688 of file LiveDebugVariables.cpp.
References llvm::cast(), DL, and printDebugLoc().
Referenced by printDebugLoc(), and printExtendedName().
|
static |
Definition at line 709 of file LiveDebugVariables.cpp.
References DL, llvm::dyn_cast(), llvm::StringRef::empty(), and printDebugLoc().
|
static |
Definition at line 1304 of file LiveDebugVariables.cpp.
References llvm::make_early_inc_range(), MBB, and MI.
Referenced by llvm::LiveDebugVariables::analyze().
| STATISTIC | ( | NumInsertedDebugLabels | , |
| "Number of DBG_LABELs inserted" | ) |
References llvm::LiveDebugVariablesWrapperLegacy::ID.
| STATISTIC | ( | NumInsertedDebugValues | , |
| "Number of DBG_VALUEs inserted" | ) |
| Debug Variable Analysis |
Definition at line 85 of file LiveDebugVariables.cpp.
| DEBUG_TYPE |
Definition at line 84 of file LiveDebugVariables.cpp.
|
static |
Referenced by llvm::LiveDebugVariables::analyze().
| Debug Variable false |
Definition at line 85 of file LiveDebugVariables.cpp.