Skip to content

Commit b9a9a1b

Browse files
committed
Revert "[RemoveDIs][NFC] Remove dbg intrinsic handling code from SelectionDAG ISel (llvm#144702)"
This reverts commit 36038a1.
1 parent 6a54522 commit b9a9a1b

File tree

4 files changed

+9
-1
lines changed

4 files changed

+9
-1
lines changed

llvm/include/llvm/CodeGen/FunctionLoweringInfo.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ namespace llvm {
3535
class Argument;
3636
class BasicBlock;
3737
class BranchProbabilityInfo;
38+
class DbgDeclareInst;
3839
class Function;
3940
class Instruction;
4041
class MachineFunction;
@@ -190,8 +191,9 @@ class FunctionLoweringInfo {
190191
/// The current call site index being processed, if any. 0 if none.
191192
unsigned CurCallSite = 0;
192193

193-
/// Collection of dbg_declare instructions handled after argument
194+
/// Collection of dbg.declare instructions handled after argument
194195
/// lowering and before ISel proper.
196+
SmallPtrSet<const DbgDeclareInst *, 8> PreprocessedDbgDeclares;
195197
SmallPtrSet<const DbgVariableRecord *, 8> PreprocessedDVRDeclares;
196198

197199
/// set - Initialize this FunctionLoweringInfo with the given Function

llvm/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -369,6 +369,7 @@ void FunctionLoweringInfo::clear() {
369369
StatepointStackSlots.clear();
370370
StatepointRelocationMaps.clear();
371371
PreferredExtendType.clear();
372+
PreprocessedDbgDeclares.clear();
372373
PreprocessedDVRDeclares.clear();
373374
}
374375

llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ class CleanupPadInst;
5656
class CleanupReturnInst;
5757
class Constant;
5858
class ConstrainedFPIntrinsic;
59+
class DbgValueInst;
5960
class DataLayout;
6061
class DIExpression;
6162
class DILocalVariable;

llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1593,6 +1593,10 @@ static bool processDbgDeclare(FunctionLoweringInfo &FuncInfo,
15931593
/// in case the declarations refer to arguments.
15941594
static void processDbgDeclares(FunctionLoweringInfo &FuncInfo) {
15951595
for (const auto &I : instructions(*FuncInfo.Fn)) {
1596+
const auto *DI = dyn_cast<DbgDeclareInst>(&I);
1597+
if (DI && processDbgDeclare(FuncInfo, DI->getAddress(), DI->getExpression(),
1598+
DI->getVariable(), DI->getDebugLoc()))
1599+
FuncInfo.PreprocessedDbgDeclares.insert(DI);
15961600
for (const DbgVariableRecord &DVR : filterDbgVars(I.getDbgRecordRange())) {
15971601
if (DVR.Type == DbgVariableRecord::LocationType::Declare &&
15981602
processDbgDeclare(FuncInfo, DVR.getVariableLocationOp(0),

0 commit comments

Comments
 (0)