LLVM  14.0.0git
Macros | Functions
DbgEntityHistoryCalculator.cpp File Reference
#include "llvm/CodeGen/DbgEntityHistoryCalculator.h"
#include "llvm/ADT/BitVector.h"
#include "llvm/ADT/Optional.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/SmallSet.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/CodeGen/LexicalScopes.h"
#include "llvm/CodeGen/MachineBasicBlock.h"
#include "llvm/CodeGen/MachineFunction.h"
#include "llvm/CodeGen/MachineInstr.h"
#include "llvm/CodeGen/MachineOperand.h"
#include "llvm/CodeGen/TargetLowering.h"
#include "llvm/CodeGen/TargetRegisterInfo.h"
#include "llvm/CodeGen/TargetSubtargetInfo.h"
#include "llvm/IR/DebugInfoMetadata.h"
#include "llvm/IR/DebugLoc.h"
#include "llvm/MC/MCRegisterInfo.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/raw_ostream.h"
#include <cassert>
#include <map>
#include <utility>
Include dependency graph for DbgEntityHistoryCalculator.cpp:

Go to the source code of this file.

Macros

#define DEBUG_TYPE   "dwarfdebug"
 

Functions

static Optional< ArrayRef< InsnRange >::iterator > intersects (const MachineInstr *StartMI, const MachineInstr *EndMI, const ArrayRef< InsnRange > &Ranges, const InstructionOrdering &Ordering)
 Check if the instruction range [StartMI, EndMI] intersects any instruction range in Ranges. More...
 
static void dropRegDescribedVar (RegDescribedVarsMap &RegVars, unsigned RegNo, InlinedEntity Var)
 
static void addRegDescribedVar (RegDescribedVarsMap &RegVars, unsigned RegNo, InlinedEntity Var)
 
static void clobberRegEntries (InlinedEntity Var, unsigned RegNo, const MachineInstr &ClobberingInstr, DbgValueEntriesMap &LiveEntries, DbgValueHistoryMap &HistMap, SmallVectorImpl< Register > &FellowRegisters)
 Create a clobbering entry and end all open debug value entries for Var that are described by RegNo using that entry. More...
 
static void handleNewDebugValue (InlinedEntity Var, const MachineInstr &DV, RegDescribedVarsMap &RegVars, DbgValueEntriesMap &LiveEntries, DbgValueHistoryMap &HistMap)
 Add a new debug value for Var. Closes all overlapping debug values. More...
 
static void clobberRegisterUses (RegDescribedVarsMap &RegVars, RegDescribedVarsMap::iterator I, DbgValueHistoryMap &HistMap, DbgValueEntriesMap &LiveEntries, const MachineInstr &ClobberingInstr)
 
static void clobberRegisterUses (RegDescribedVarsMap &RegVars, unsigned RegNo, DbgValueHistoryMap &HistMap, DbgValueEntriesMap &LiveEntries, const MachineInstr &ClobberingInstr)
 

Macro Definition Documentation

◆ DEBUG_TYPE

#define DEBUG_TYPE   "dwarfdebug"

Definition at line 34 of file DbgEntityHistoryCalculator.cpp.

Function Documentation

◆ addRegDescribedVar()

static void addRegDescribedVar ( RegDescribedVarsMap &  RegVars,
unsigned  RegNo,
InlinedEntity  Var 
)
static

Definition at line 311 of file DbgEntityHistoryCalculator.cpp.

References assert(), and llvm::is_contained().

◆ clobberRegEntries()

static void clobberRegEntries ( InlinedEntity  Var,
unsigned  RegNo,
const MachineInstr ClobberingInstr,
DbgValueEntriesMap &  LiveEntries,
DbgValueHistoryMap HistMap,
SmallVectorImpl< Register > &  FellowRegisters 
)
static

Create a clobbering entry and end all open debug value entries for Var that are described by RegNo using that entry.

Inserts into FellowRegisters the set of Registers that were also used to describe Var alongside RegNo.

Definition at line 323 of file DbgEntityHistoryCalculator.cpp.

References Index, and llvm::DbgValueHistoryMap::startClobber().

Referenced by clobberRegisterUses().

◆ clobberRegisterUses() [1/2]

static void clobberRegisterUses ( RegDescribedVarsMap &  RegVars,
RegDescribedVarsMap::iterator  I,
DbgValueHistoryMap HistMap,
DbgValueEntriesMap &  LiveEntries,
const MachineInstr ClobberingInstr 
)
static

◆ clobberRegisterUses() [2/2]

static void clobberRegisterUses ( RegDescribedVarsMap &  RegVars,
unsigned  RegNo,
DbgValueHistoryMap HistMap,
DbgValueEntriesMap &  LiveEntries,
const MachineInstr ClobberingInstr 
)
static

Definition at line 440 of file DbgEntityHistoryCalculator.cpp.

References clobberRegisterUses(), and I.

◆ dropRegDescribedVar()

static void dropRegDescribedVar ( RegDescribedVarsMap &  RegVars,
unsigned  RegNo,
InlinedEntity  Var 
)
static

Definition at line 297 of file DbgEntityHistoryCalculator.cpp.

References assert(), llvm::find(), and I.

Referenced by clobberRegisterUses().

◆ handleNewDebugValue()

static void handleNewDebugValue ( InlinedEntity  Var,
const MachineInstr DV,
RegDescribedVarsMap &  RegVars,
DbgValueEntriesMap &  LiveEntries,
DbgValueHistoryMap HistMap 
)
static

Add a new debug value for Var. Closes all overlapping debug values.

Definition at line 364 of file DbgEntityHistoryCalculator.cpp.

References llvm::MachineInstr::getDebugExpression(), Index, and llvm::DbgValueHistoryMap::startDbgValue().

Referenced by llvm::calculateDbgEntityHistory().

◆ intersects()

static Optional<ArrayRef<InsnRange>::iterator> intersects ( const MachineInstr StartMI,
const MachineInstr EndMI,
const ArrayRef< InsnRange > &  Ranges,
const InstructionOrdering Ordering 
)
static

Check if the instruction range [StartMI, EndMI] intersects any instruction range in Ranges.

EndMI can be nullptr to indicate that the range is unbounded. Assumes Ranges is ordered and disjoint. Returns true and points to the first intersecting scope range if one exists.

Definition at line 115 of file DbgEntityHistoryCalculator.cpp.

References llvm::ArrayRef< T >::begin(), llvm::ArrayRef< T >::end(), llvm::InstructionOrdering::isBefore(), and llvm::None.

Referenced by llvm::DbgValueHistoryMap::trimLocationRanges().