21#ifndef LLVM_TRANSFORMS_UTILS_DEBUGSSAUPDATER_H
22#define LLVM_TRANSFORMS_UTILS_DEBUGSSAUPDATER_H
204 "Only one PHI should exist per-block per-variable");
239 for (
auto &
Block : BlockMap)
244 for (
auto &
Block : BlockMap)
248 InsertedPHIs->clear();
257 auto it = BlockMap.find(BB);
258 if (it == BlockMap.end()) {
260 it = BlockMap.find(BB);
341 OrigVariableValueRangeTable;
347 return OrigVariableValueRangeTable.contains(DVA) ||
348 OrigSingleLocVariableValueTable.contains(DVA);
351 return OrigSingleLocVariableValueTable.contains(DVA);
354 return OrigVariableValueRangeTable[DVA];
357 return OrigSingleLocVariableValueTable[DVA];
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
This file provides various utilities for inspecting and working with the control flow graph in LLVM I...
This file defines the SmallVector class.
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
LLVM Basic Block Representation.
InstListType::iterator iterator
Instruction iterators...
Thin wrapper around a block successor iterator.
DbgSSABlockPredIterator(pred_iterator PredIt, DebugSSAUpdater &Updater)
DebugSSAUpdater & Updater
bool operator!=(const DbgSSABlockPredIterator &OtherIt) const
DbgSSABlockPredIterator & operator++()
DbgSSABlock * operator*()
Thin wrapper around a block successor iterator.
DebugSSAUpdater & Updater
DbgSSABlock * operator*()
DbgSSABlockSuccIterator(succ_iterator SuccIt, DebugSSAUpdater &Updater)
bool operator!=(const DbgSSABlockSuccIterator &OtherIt) const
DbgSSABlockSuccIterator & operator++()
DebugSSAUpdater & Updater
iterator_range< DbgSSABlockPredIterator > predecessors()
DbgSSABlockSuccIterator succ_end()
SmallVector< DbgSSAPhi, 1 > PHIListT
DbgSSABlockPredIterator pred_end()
DbgSSABlockPredIterator pred_begin()
DbgSSABlockSuccIterator succ_begin()
PHIListT & phis()
SSAUpdater wishes to know what PHIs already exist in this block.
PHIListT PHIList
List of PHIs in this block.
DbgSSAPhi * newPHI()
SSAUpdater has requested a PHI: create that within this block record.
iterator_range< DbgSSABlockSuccIterator > successors()
DbgSSABlock(BasicBlock &BB, DebugSSAUpdater &Updater)
Represents the live-in definitions of a variable to a block with multiple predecessors.
SmallVector< std::pair< DbgSSABlock *, DbgValueDef >, 4 > IncomingValues
void addIncoming(DbgSSABlock *BB, DbgValueDef DV)
DbgSSABlock * getParent()
DbgSSAPhi(DbgSSABlock *ParentBlock)
void print(raw_ostream &OS) const
DbgSSABlock * ParentBlock
DbgValueDef getIncomingValue(size_t Idx)
unsigned getNumIncomingValues() const
DbgSSABlock * getIncomingBlock(size_t Idx)
Utility class used to find and store the live debug ranges for variables in a module.
DbgValueDef getSingleLoc(DebugVariableAggregate DVA)
ArrayRef< DbgRangeEntry > getVariableRanges(DebugVariableAggregate DVA)
void printValues(DebugVariableAggregate DVA, raw_ostream &OS)
void addVariable(Function *F, DebugVariableAggregate DVA)
bool hasSingleLocEntry(DebugVariableAggregate DVA) const
bool hasVariableEntry(DebugVariableAggregate DVA) const
Record of a variable value-assignment, aka a non instruction representation of the dbg....
LLVM_ABI bool isKillLocation() const
bool isAddressOfVariable() const
Does this describe the address of a local variable.
DIExpression * getExpression() const
Metadata * getRawLocation() const
Returns the metadata operand for the first location description.
Class used to determine the live ranges of debug variables in IR using SSA construction (via the SSAU...
DebugSSAUpdater(SmallVectorImpl< DbgSSAPhi * > *InsertedPHIs=nullptr)
If InsertedPHIs is specified, it will be filled in with all PHI Nodes created by rewriting.
DebugSSAUpdater & operator=(const DebugSSAUpdater &)=delete
DbgValueDef findValueForBlock(DbgSSABlock *BB) const
Return the value for the specified block if the DebugSSAUpdater has one, otherwise return nullptr.
DebugSSAUpdater(const DebugSSAUpdater &)=delete
void addAvailableValue(DbgSSABlock *BB, DbgValueDef DV)
Indicate that a rewritten value is available in the specified block with the specified value.
DbgValueDef getValueAtEndOfBlock(DbgSSABlock *BB)
Construct SSA form, materializing a value that is live at the end of the specified block.
DbgSSABlock * getDbgSSABlock(BasicBlock *BB)
For a given BB, create a wrapper block for it.
DbgValueDef getValueInMiddleOfBlock(DbgSSABlock *BB)
Construct SSA form, materializing a value that is live in the middle of the specified block.
bool hasValueForBlock(DbgSSABlock *BB) const
Return true if the DebugSSAUpdater already has a value for the specified block.
Identifies a unique instance of a whole variable (discards/ignores fragment information).
Utility class used to store the names of SSA values after their owning modules have been destroyed.
std::string getName(ValueID ID)
ValueID addValue(Value *V)
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
LLVM Value Representation.
A range adaptor for a pair of iterators.
This class implements an extremely fast bulk output stream that can only output to a stream.
unsigned ID
LLVM IR allows to use arbitrary numbers as calling convention identifiers.
This is an optimization pass for GlobalISel generic memory operations.
auto pred_end(const MachineBasicBlock *BB)
RNSuccIterator< NodeRef, BlockT, RegionT > succ_begin(NodeRef Node)
iterator_range(Container &&) -> iterator_range< llvm::detail::IterOfRange< Container > >
RNSuccIterator< NodeRef, BlockT, RegionT > succ_end(NodeRef Node)
PredIterator< BasicBlock, Value::user_iterator > pred_iterator
raw_ostream & operator<<(raw_ostream &OS, const APFixedPoint &FX)
auto pred_begin(const MachineBasicBlock *BB)
SuccIterator< Instruction, BasicBlock > succ_iterator
BasicBlock::iterator Start
A definition of a variable; can represent either a debug value, no definition (the variable has not y...
DbgValueDef(DbgVariableRecord *DVR)
DbgValueDef(DbgSSAPhi *Phi)
bool operator!=(DbgValueDef Other) const
void print(raw_ostream &OS) const
DIExpression * Expression
bool operator==(DbgValueDef Other) const
DbgValueDef(bool IsMemory, Metadata *Locations, DIExpression *Expression)
bool agreesWith(DbgValueDef Other) const
This class defines the default behavior for configurable aspects of ValueMap<>.