Skip to content

Commit 9eb0020

Browse files
jmorsenikic
andauthored
[DebugInfo][RemoveDIs] Remove a swathe of debug-intrinsic code (llvm#144389)
Seeing how we can't generate any debug intrinsics any more: delete a variety of codepaths where they're handled. For the most part these are plain deletions, in others I've tweaked comments to remain coherent, or added a type to (what was) type-generic-lambdas. This isn't all the DbgInfoIntrinsic call sites but it's most of the simple scenarios. Co-authored-by: Nikita Popov <[email protected]>
1 parent 7ec103a commit 9eb0020

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+104
-400
lines changed

llvm/include/llvm/Analysis/IRSimilarityIdentifier.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -545,10 +545,6 @@ struct IRInstructionMapper {
545545
// dependent.
546546
InstrType visitLandingPadInst(LandingPadInst &LPI) { return Illegal; }
547547
InstrType visitFuncletPadInst(FuncletPadInst &FPI) { return Illegal; }
548-
// DebugInfo should be included in the regions, but should not be
549-
// analyzed for similarity as it has no bearing on the outcome of the
550-
// program.
551-
InstrType visitDbgInfoIntrinsic(DbgInfoIntrinsic &DII) { return Invisible; }
552548
InstrType visitIntrinsicInst(IntrinsicInst &II) {
553549
// These are disabled due to complications in the CodeExtractor when
554550
// outlining these instructions. For instance, It is unclear what we

llvm/include/llvm/Analysis/PtrUseVisitor.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,6 @@ class PtrUseVisitor : protected InstVisitor<DerivedT>,
285285

286286
// No-op intrinsics which we know don't escape the pointer to logic in
287287
// some other function.
288-
void visitDbgInfoIntrinsic(DbgInfoIntrinsic &I) {}
289288
void visitMemIntrinsic(MemIntrinsic &I) {}
290289
void visitIntrinsicInst(IntrinsicInst &II) {
291290
switch (II.getIntrinsicID()) {

llvm/include/llvm/IR/InstVisitor.h

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -199,13 +199,6 @@ class InstVisitor {
199199
RetTy visitCatchPadInst(CatchPadInst &I) { DELEGATE(FuncletPadInst); }
200200
RetTy visitFreezeInst(FreezeInst &I) { DELEGATE(Instruction); }
201201

202-
// Handle the special intrinsic instruction classes.
203-
RetTy visitDbgDeclareInst(DbgDeclareInst &I) { DELEGATE(DbgVariableIntrinsic);}
204-
RetTy visitDbgValueInst(DbgValueInst &I) { DELEGATE(DbgVariableIntrinsic);}
205-
RetTy visitDbgVariableIntrinsic(DbgVariableIntrinsic &I)
206-
{ DELEGATE(DbgInfoIntrinsic);}
207-
RetTy visitDbgLabelInst(DbgLabelInst &I) { DELEGATE(DbgInfoIntrinsic);}
208-
RetTy visitDbgInfoIntrinsic(DbgInfoIntrinsic &I){ DELEGATE(IntrinsicInst); }
209202
RetTy visitMemSetInst(MemSetInst &I) { DELEGATE(MemIntrinsic); }
210203
RetTy visitMemSetPatternInst(MemSetPatternInst &I) {
211204
DELEGATE(IntrinsicInst);
@@ -286,9 +279,6 @@ class InstVisitor {
286279
if (const Function *F = I.getCalledFunction()) {
287280
switch (F->getIntrinsicID()) {
288281
default: DELEGATE(IntrinsicInst);
289-
case Intrinsic::dbg_declare: DELEGATE(DbgDeclareInst);
290-
case Intrinsic::dbg_value: DELEGATE(DbgValueInst);
291-
case Intrinsic::dbg_label: DELEGATE(DbgLabelInst);
292282
case Intrinsic::memcpy:
293283
case Intrinsic::memcpy_inline:
294284
DELEGATE(MemCpyInst);

llvm/include/llvm/Transforms/Utils/Local.h

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -394,12 +394,9 @@ handleUnreachableTerminator(Instruction *I,
394394
SmallVectorImpl<Value *> &PoisonedValues);
395395

396396
/// Remove all instructions from a basic block other than its terminator
397-
/// and any present EH pad instructions. Returns a pair where the first element
398-
/// is the number of instructions (excluding debug info intrinsics) that have
399-
/// been removed, and the second element is the number of debug info intrinsics
397+
/// and any present EH pad instructions. Returns the number of instructions
400398
/// that have been removed.
401-
LLVM_ABI std::pair<unsigned, unsigned>
402-
removeAllNonTerminatorAndEHPadInstructions(BasicBlock *BB);
399+
LLVM_ABI unsigned removeAllNonTerminatorAndEHPadInstructions(BasicBlock *BB);
403400

404401
/// Insert an unreachable instruction before the specified
405402
/// instruction, making it and the rest of the code in the block dead.

llvm/lib/Analysis/AliasSetTracker.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -343,9 +343,6 @@ void AliasSetTracker::add(AnyMemTransferInst *MTI) {
343343
}
344344

345345
void AliasSetTracker::addUnknown(Instruction *Inst) {
346-
if (isa<DbgInfoIntrinsic>(Inst))
347-
return; // Ignore DbgInfo Intrinsics.
348-
349346
if (auto *II = dyn_cast<IntrinsicInst>(Inst)) {
350347
// These intrinsics will show up as affecting memory, but they are just
351348
// markers.

llvm/lib/Analysis/CallGraph.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,7 @@ CallGraph::CallGraph(Module &M)
3434
CallsExternalNode(std::make_unique<CallGraphNode>(this, nullptr)) {
3535
// Add every interesting function to the call graph.
3636
for (Function &F : M)
37-
if (!isDbgInfoIntrinsic(F.getIntrinsicID()))
38-
addToCallGraph(&F);
37+
addToCallGraph(&F);
3938
}
4039

4140
CallGraph::CallGraph(CallGraph &&Arg)
@@ -101,7 +100,7 @@ void CallGraph::populateCallGraphNode(CallGraphNode *Node) {
101100
const Function *Callee = Call->getCalledFunction();
102101
if (!Callee)
103102
Node->addCalledFunction(Call, CallsExternalNode.get());
104-
else if (!isDbgInfoIntrinsic(Callee->getIntrinsicID()))
103+
else
105104
Node->addCalledFunction(Call, getOrInsertFunction(Callee));
106105

107106
// Add reference to callback functions.

llvm/lib/Analysis/DemandedBits.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,7 @@ using namespace llvm::PatternMatch;
4646
#define DEBUG_TYPE "demanded-bits"
4747

4848
static bool isAlwaysLive(Instruction *I) {
49-
return I->isTerminator() || isa<DbgInfoIntrinsic>(I) || I->isEHPad() ||
50-
I->mayHaveSideEffects();
49+
return I->isTerminator() || I->isEHPad() || I->mayHaveSideEffects();
5150
}
5251

5352
void DemandedBits::determineLiveOperandBits(

llvm/lib/Analysis/Loads.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -434,7 +434,7 @@ bool llvm::isSafeToLoadUnconditionally(Value *V, Align Alignment, const APInt &S
434434
// If we see a free or a call which may write to memory (i.e. which might do
435435
// a free) the pointer could be marked invalid.
436436
if (isa<CallInst>(BBI) && BBI->mayWriteToMemory() &&
437-
!isa<LifetimeIntrinsic>(BBI) && !isa<DbgInfoIntrinsic>(BBI))
437+
!isa<LifetimeIntrinsic>(BBI))
438438
return false;
439439

440440
Value *AccessedPtr;

llvm/lib/Analysis/MemoryDependenceAnalysis.cpp

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -188,9 +188,6 @@ MemDepResult MemoryDependenceResults::getCallDependencyFrom(
188188
// Walk backwards through the block, looking for dependencies.
189189
while (ScanIt != BB->begin()) {
190190
Instruction *Inst = &*--ScanIt;
191-
// Debug intrinsics don't cause dependences and should not affect Limit
192-
if (isa<DbgInfoIntrinsic>(Inst))
193-
continue;
194191

195192
// Limit the amount of scanning we do so we don't end up with quadratic
196193
// running time on extreme testcases.
@@ -432,11 +429,6 @@ MemDepResult MemoryDependenceResults::getSimplePointerDependencyFrom(
432429
while (ScanIt != BB->begin()) {
433430
Instruction *Inst = &*--ScanIt;
434431

435-
if (IntrinsicInst *II = dyn_cast<IntrinsicInst>(Inst))
436-
// Debug intrinsics don't (and can't) cause dependencies.
437-
if (isa<DbgInfoIntrinsic>(II))
438-
continue;
439-
440432
// Limit the amount of scanning we do so we don't end up with quadratic
441433
// running time on extreme testcases.
442434
--*Limit;

llvm/lib/Analysis/ValueTracking.cpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7846,8 +7846,6 @@ bool llvm::isGuaranteedToTransferExecutionToSuccessor(
78467846
iterator_range<BasicBlock::const_iterator> Range, unsigned ScanLimit) {
78477847
assert(ScanLimit && "scan limit must be non-zero");
78487848
for (const Instruction &I : Range) {
7849-
if (isa<DbgInfoIntrinsic>(I))
7850-
continue;
78517849
if (--ScanLimit == 0)
78527850
return false;
78537851
if (!isGuaranteedToTransferExecutionToSuccessor(&I))
@@ -8050,8 +8048,6 @@ static bool programUndefinedIfUndefOrPoison(const Value *V,
80508048
// well-defined operands.
80518049

80528050
for (const auto &I : make_range(Begin, End)) {
8053-
if (isa<DbgInfoIntrinsic>(I))
8054-
continue;
80558051
if (--ScanLimit == 0)
80568052
break;
80578053

@@ -8076,8 +8072,6 @@ static bool programUndefinedIfUndefOrPoison(const Value *V,
80768072

80778073
while (true) {
80788074
for (const auto &I : make_range(Begin, End)) {
8079-
if (isa<DbgInfoIntrinsic>(I))
8080-
continue;
80818075
if (--ScanLimit == 0)
80828076
return false;
80838077
if (mustTriggerUB(&I, YieldsPoison))

llvm/lib/CodeGen/CodeGenPrepare.cpp

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -896,12 +896,7 @@ BasicBlock *CodeGenPrepare::findDestBlockOfMergeableEmptyBlock(BasicBlock *BB) {
896896
BasicBlock::iterator BBI = BI->getIterator();
897897
if (BBI != BB->begin()) {
898898
--BBI;
899-
while (isa<DbgInfoIntrinsic>(BBI)) {
900-
if (BBI == BB->begin())
901-
break;
902-
--BBI;
903-
}
904-
if (!isa<DbgInfoIntrinsic>(BBI) && !isa<PHINode>(BBI))
899+
if (!isa<PHINode>(BBI))
905900
return nullptr;
906901
}
907902

@@ -2981,10 +2976,9 @@ bool CodeGenPrepare::dupRetToEnableTailCallOpts(BasicBlock *BB,
29812976
// Make sure there are no instructions between the first instruction
29822977
// and return.
29832978
BasicBlock::const_iterator BI = BB->getFirstNonPHIIt();
2984-
// Skip over debug and the bitcast.
2985-
while (isa<DbgInfoIntrinsic>(BI) || &*BI == BCI || &*BI == EVI ||
2986-
isa<PseudoProbeInst>(BI) || isLifetimeEndOrBitCastFor(&*BI) ||
2987-
isFakeUse(&*BI))
2979+
// Skip over pseudo-probes and the bitcast.
2980+
while (&*BI == BCI || &*BI == EVI || isa<PseudoProbeInst>(BI) ||
2981+
isLifetimeEndOrBitCastFor(&*BI) || isFakeUse(&*BI))
29882982
BI = std::next(BI);
29892983
if (&*BI != RetI)
29902984
return false;

llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1320,10 +1320,7 @@ void SelectionDAGBuilder::visit(const Instruction &I) {
13201320
HandlePHINodesInSuccessorBlocks(I.getParent());
13211321
}
13221322

1323-
// Increase the SDNodeOrder if dealing with a non-debug instruction.
1324-
if (!isa<DbgInfoIntrinsic>(I))
1325-
++SDNodeOrder;
1326-
1323+
++SDNodeOrder;
13271324
CurInst = &I;
13281325

13291326
// Set inserted listener only if required.

llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1507,7 +1507,6 @@ static bool isFoldedOrDeadInstruction(const Instruction *I,
15071507
const FunctionLoweringInfo &FuncInfo) {
15081508
return !I->mayWriteToMemory() && // Side-effecting instructions aren't folded.
15091509
!I->isTerminator() && // Terminators aren't folded.
1510-
!isa<DbgInfoIntrinsic>(I) && // Debug instructions aren't folded.
15111510
!I->isEHPad() && // EH pad instructions aren't folded.
15121511
!FuncInfo.isExportedInst(I); // Exported instrs must be computed.
15131512
}

llvm/lib/IR/DebugInfo.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -586,11 +586,6 @@ bool llvm::stripDebugInfo(Function &F) {
586586
DenseMap<MDNode *, MDNode *> LoopIDsMap;
587587
for (BasicBlock &BB : F) {
588588
for (Instruction &I : llvm::make_early_inc_range(BB)) {
589-
if (isa<DbgInfoIntrinsic>(&I)) {
590-
I.eraseFromParent();
591-
Changed = true;
592-
continue;
593-
}
594589
if (I.getDebugLoc()) {
595590
Changed = true;
596591
I.setDebugLoc(DebugLoc());

llvm/lib/Target/AArch64/AArch64StackTagging.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -369,8 +369,7 @@ Instruction *AArch64StackTagging::collectInitializers(Instruction *StartInst,
369369

370370
unsigned Count = 0;
371371
for (; Count < ClScanLimit && !BI->isTerminator(); ++BI) {
372-
if (!isa<DbgInfoIntrinsic>(*BI))
373-
++Count;
372+
++Count;
374373

375374
if (isNoModRef(AA->getModRefInfo(&*BI, AllocaLoc)))
376375
continue;

llvm/lib/Target/Hexagon/HexagonLoopIdiomRecognition.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2318,7 +2318,7 @@ bool HexagonLoopIdiomRecognize::coverLoop(Loop *L,
23182318
// instructions in it that are not involved in the original set Insts.
23192319
for (auto *B : L->blocks()) {
23202320
for (auto &In : *B) {
2321-
if (isa<BranchInst>(In) || isa<DbgInfoIntrinsic>(In))
2321+
if (isa<BranchInst>(In))
23222322
continue;
23232323
if (!Worklist.count(&In) && In.mayHaveSideEffects())
23242324
return false;

llvm/lib/Target/PowerPC/PPCBoolRetToInt.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ class PPCBoolRetToInt : public FunctionPass {
117117

118118
// A PHINode is Promotable if:
119119
// 1. Its type is i1 AND
120-
// 2. All of its uses are ReturnInt, CallInst, PHINode, or DbgInfoIntrinsic
120+
// 2. All of its uses are ReturnInt, CallInst, or PHINode
121121
// AND
122122
// 3. All of its operands are Constant or Argument or
123123
// CallInst or PHINode AND
@@ -136,8 +136,7 @@ class PPCBoolRetToInt : public FunctionPass {
136136
for (const PHINode *P : Promotable) {
137137
// Condition 2 and 3
138138
auto IsValidUser = [] (const Value *V) -> bool {
139-
return isa<ReturnInst>(V) || isa<CallInst>(V) || isa<PHINode>(V) ||
140-
isa<DbgInfoIntrinsic>(V);
139+
return isa<ReturnInst>(V) || isa<CallInst>(V) || isa<PHINode>(V);
141140
};
142141
auto IsValidOperand = [] (const Value *V) -> bool {
143142
return isa<Constant>(V) || isa<Argument>(V) || isa<CallInst>(V) ||

llvm/lib/Transforms/AggressiveInstCombine/AggressiveInstCombine.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -719,9 +719,7 @@ static bool foldLoadsRecursive(Value *V, LoadOps &LOps, const DataLayout &DL,
719719
if (Inst.mayWriteToMemory() && isModSet(AA.getModRefInfo(&Inst, Loc)))
720720
return false;
721721

722-
// Ignore debug info so that's not counted against MaxInstrsToScan.
723-
// Otherwise debug info could affect codegen.
724-
if (!isa<DbgInfoIntrinsic>(Inst) && ++NumScanned > MaxInstrsToScan)
722+
if (++NumScanned > MaxInstrsToScan)
725723
return false;
726724
}
727725

llvm/lib/Transforms/IPO/IROutliner.cpp

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -717,8 +717,6 @@ static void moveFunctionData(Function &Old, Function &New,
717717
if (ReturnInst *RI = dyn_cast<ReturnInst>(I))
718718
NewEnds.insert(std::make_pair(RI->getReturnValue(), &CurrBB));
719719

720-
std::vector<Instruction *> DebugInsts;
721-
722720
for (Instruction &Val : CurrBB) {
723721
// Since debug-info originates from many different locations in the
724722
// program, it will cause incorrect reporting from a debugger if we keep
@@ -749,21 +747,12 @@ static void moveFunctionData(Function &Old, Function &New,
749747
// From this point we are only handling call instructions.
750748
CallInst *CI = cast<CallInst>(&Val);
751749

752-
// Collect debug intrinsics for later removal.
753-
if (isa<DbgInfoIntrinsic>(CI)) {
754-
DebugInsts.push_back(&Val);
755-
continue;
756-
}
757-
758750
// Edit the scope of called functions inside of outlined functions.
759751
if (DISubprogram *SP = New.getSubprogram()) {
760752
DILocation *DI = DILocation::get(New.getContext(), 0, 0, SP);
761753
Val.setDebugLoc(DI);
762754
}
763755
}
764-
765-
for (Instruction *I : DebugInsts)
766-
I->eraseFromParent();
767756
}
768757
}
769758

llvm/lib/Transforms/IPO/SampleProfileProbe.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -385,8 +385,7 @@ void SampleProfileProber::instrumentOneFunc(Function &F, TargetMachine *TM) {
385385
// line number. Real instructions generated by optimizations may not come
386386
// with a line number either.
387387
auto HasValidDbgLine = [](Instruction *J) {
388-
return !isa<PHINode>(J) && !isa<DbgInfoIntrinsic>(J) &&
389-
!J->isLifetimeStartOrEnd() && J->getDebugLoc();
388+
return !isa<PHINode>(J) && !J->isLifetimeStartOrEnd() && J->getDebugLoc();
390389
};
391390

392391
Instruction *J = &*BB->getFirstInsertionPt();

llvm/lib/Transforms/InstCombine/InstructionCombining.cpp

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4787,11 +4787,7 @@ bool InstCombinerImpl::freezeOtherUses(FreezeInst &FI) {
47874787
MoveBefore = *MoveBeforeOpt;
47884788
}
47894789

4790-
// Don't move to the position of a debug intrinsic.
4791-
if (isa<DbgInfoIntrinsic>(MoveBefore))
4792-
MoveBefore = MoveBefore->getNextNonDebugInstruction()->getIterator();
4793-
// Re-point iterator to come after any debug-info records, if we're
4794-
// running in "RemoveDIs" mode
4790+
// Re-point iterator to come after any debug-info records.
47954791
MoveBefore.setHeadBit(false);
47964792

47974793
bool Changed = false;
@@ -5582,11 +5578,9 @@ bool InstCombinerImpl::prepareWorklist(Function &F) {
55825578
continue;
55835579

55845580
unsigned NumDeadInstInBB;
5585-
unsigned NumDeadDbgInstInBB;
5586-
std::tie(NumDeadInstInBB, NumDeadDbgInstInBB) =
5587-
removeAllNonTerminatorAndEHPadInstructions(&BB);
5581+
NumDeadInstInBB = removeAllNonTerminatorAndEHPadInstructions(&BB);
55885582

5589-
MadeIRChange |= NumDeadInstInBB + NumDeadDbgInstInBB > 0;
5583+
MadeIRChange |= NumDeadInstInBB != 0;
55905584
NumDeadInst += NumDeadInstInBB;
55915585
}
55925586

llvm/lib/Transforms/Instrumentation/GCOVProfiling.cpp

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -583,10 +583,6 @@ static bool functionHasLines(const Function &F, unsigned &EndLine) {
583583
EndLine = 0;
584584
for (const auto &BB : F) {
585585
for (const auto &I : BB) {
586-
// Debug intrinsic locations correspond to the location of the
587-
// declaration, not necessarily any statements or expressions.
588-
if (isa<DbgInfoIntrinsic>(&I)) continue;
589-
590586
const DebugLoc &Loc = I.getDebugLoc();
591587
if (!Loc)
592588
continue;
@@ -874,10 +870,6 @@ bool GCOVProfiler::emitProfileNotes(
874870
}
875871

876872
for (const auto &I : BB) {
877-
// Debug intrinsic locations correspond to the location of the
878-
// declaration, not necessarily any statements or expressions.
879-
if (isa<DbgInfoIntrinsic>(&I)) continue;
880-
881873
const DebugLoc &Loc = I.getDebugLoc();
882874
if (!Loc)
883875
continue;

llvm/lib/Transforms/Instrumentation/ThreadSanitizer.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -527,8 +527,7 @@ bool ThreadSanitizer::sanitizeFunction(Function &F,
527527
AtomicAccesses.push_back(&Inst);
528528
else if (isa<LoadInst>(Inst) || isa<StoreInst>(Inst))
529529
LocalLoadsAndStores.push_back(&Inst);
530-
else if ((isa<CallInst>(Inst) && !isa<DbgInfoIntrinsic>(Inst)) ||
531-
isa<InvokeInst>(Inst)) {
530+
else if (isa<CallInst>(Inst) || isa<InvokeInst>(Inst)) {
532531
if (CallInst *CI = dyn_cast<CallInst>(&Inst))
533532
maybeMarkSanitizerLibraryCallNoBuiltin(CI, &TLI);
534533
if (isa<MemIntrinsic>(Inst))

llvm/lib/Transforms/Scalar/ADCE.cpp

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -562,20 +562,7 @@ ADCEChanged AggressiveDeadCodeElimination::removeDeadInstructions() {
562562
if (isLive(&I))
563563
continue;
564564

565-
if (auto *DII = dyn_cast<DbgInfoIntrinsic>(&I)) {
566-
// Avoid removing a dbg.assign that is linked to instructions because it
567-
// holds information about an existing store.
568-
if (auto *DAI = dyn_cast<DbgAssignIntrinsic>(DII))
569-
if (!at::getAssignmentInsts(DAI).empty())
570-
continue;
571-
// Check if the scope of this variable location is alive.
572-
if (AliveScopes.count(DII->getDebugLoc()->getScope()))
573-
continue;
574-
575-
// Fallthrough and drop the intrinsic.
576-
} else {
577-
Changed.ChangedNonDebugInstr = true;
578-
}
565+
Changed.ChangedNonDebugInstr = true;
579566

580567
// Prepare to delete.
581568
Worklist.push_back(&I);

0 commit comments

Comments
 (0)