Skip to content

Commit 9767ba6

Browse files
committed
Revert "[DebugInfo][RemoveDIs] Remove a swathe of debug-intrinsic code (llvm#144389)"
This reverts commit 9eb0020.
1 parent 719fd29 commit 9767ba6

39 files changed

+347
-96
lines changed

llvm/include/llvm/Analysis/IRSimilarityIdentifier.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -545,6 +545,10 @@ 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; }
548552
InstrType visitIntrinsicInst(IntrinsicInst &II) {
549553
// These are disabled due to complications in the CodeExtractor when
550554
// outlining these instructions. For instance, It is unclear what we

llvm/include/llvm/Analysis/PtrUseVisitor.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,7 @@ 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) {}
288289
void visitMemIntrinsic(MemIntrinsic &I) {}
289290
void visitIntrinsicInst(IntrinsicInst &II) {
290291
switch (II.getIntrinsicID()) {

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

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -394,9 +394,12 @@ 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 the number of instructions
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
398400
/// that have been removed.
399-
LLVM_ABI unsigned removeAllNonTerminatorAndEHPadInstructions(BasicBlock *BB);
401+
LLVM_ABI std::pair<unsigned, unsigned>
402+
removeAllNonTerminatorAndEHPadInstructions(BasicBlock *BB);
400403

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

llvm/lib/Analysis/AliasSetTracker.cpp

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

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

llvm/lib/Analysis/CallGraph.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@ 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-
addToCallGraph(&F);
37+
if (!isDbgInfoIntrinsic(F.getIntrinsicID()))
38+
addToCallGraph(&F);
3839
}
3940

4041
CallGraph::CallGraph(CallGraph &&Arg)
@@ -100,7 +101,7 @@ void CallGraph::populateCallGraphNode(CallGraphNode *Node) {
100101
const Function *Callee = Call->getCalledFunction();
101102
if (!Callee)
102103
Node->addCalledFunction(Call, CallsExternalNode.get());
103-
else
104+
else if (!isDbgInfoIntrinsic(Callee->getIntrinsicID()))
104105
Node->addCalledFunction(Call, getOrInsertFunction(Callee));
105106

106107
// Add reference to callback functions.

llvm/lib/Analysis/DemandedBits.cpp

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

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

5253
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))
437+
!isa<LifetimeIntrinsic>(BBI) && !isa<DbgInfoIntrinsic>(BBI))
438438
return false;
439439

440440
Value *AccessedPtr;

llvm/lib/Analysis/MemoryDependenceAnalysis.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,9 @@ 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;
191194

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

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+
432440
// Limit the amount of scanning we do so we don't end up with quadratic
433441
// running time on extreme testcases.
434442
--*Limit;

llvm/lib/Analysis/ValueTracking.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7846,6 +7846,8 @@ 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;
78497851
if (--ScanLimit == 0)
78507852
return false;
78517853
if (!isGuaranteedToTransferExecutionToSuccessor(&I))
@@ -8048,6 +8050,8 @@ static bool programUndefinedIfUndefOrPoison(const Value *V,
80488050
// well-defined operands.
80498051

80508052
for (const auto &I : make_range(Begin, End)) {
8053+
if (isa<DbgInfoIntrinsic>(I))
8054+
continue;
80518055
if (--ScanLimit == 0)
80528056
break;
80538057

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

80738077
while (true) {
80748078
for (const auto &I : make_range(Begin, End)) {
8079+
if (isa<DbgInfoIntrinsic>(I))
8080+
continue;
80758081
if (--ScanLimit == 0)
80768082
return false;
80778083
if (mustTriggerUB(&I, YieldsPoison))

llvm/lib/CodeGen/CodeGenPrepare.cpp

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

@@ -2976,9 +2981,10 @@ bool CodeGenPrepare::dupRetToEnableTailCallOpts(BasicBlock *BB,
29762981
// Make sure there are no instructions between the first instruction
29772982
// and return.
29782983
BasicBlock::const_iterator BI = BB->getFirstNonPHIIt();
2979-
// Skip over pseudo-probes and the bitcast.
2980-
while (&*BI == BCI || &*BI == EVI || isa<PseudoProbeInst>(BI) ||
2981-
isLifetimeEndOrBitCastFor(&*BI) || isFakeUse(&*BI))
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))
29822988
BI = std::next(BI);
29832989
if (&*BI != RetI)
29842990
return false;

llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp

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

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

13261329
// Set inserted listener only if required.

llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1507,6 +1507,7 @@ 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.
15101511
!I->isEHPad() && // EH pad instructions aren't folded.
15111512
!FuncInfo.isExportedInst(I); // Exported instrs must be computed.
15121513
}

llvm/lib/IR/DebugInfo.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -586,6 +586,11 @@ 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+
}
589594
if (I.getDebugLoc()) {
590595
Changed = true;
591596
I.setDebugLoc(DebugLoc());

llvm/lib/Target/AArch64/AArch64StackTagging.cpp

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

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

374375
if (isNoModRef(AA->getModRefInfo(&*BI, AllocaLoc)))
375376
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))
2321+
if (isa<BranchInst>(In) || isa<DbgInfoIntrinsic>(In))
23222322
continue;
23232323
if (!Worklist.count(&In) && In.mayHaveSideEffects())
23242324
return false;

llvm/lib/Target/PowerPC/PPCBoolRetToInt.cpp

Lines changed: 3 additions & 2 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, or PHINode
120+
// 2. All of its uses are ReturnInt, CallInst, PHINode, or DbgInfoIntrinsic
121121
// AND
122122
// 3. All of its operands are Constant or Argument or
123123
// CallInst or PHINode AND
@@ -136,7 +136,8 @@ 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);
139+
return isa<ReturnInst>(V) || isa<CallInst>(V) || isa<PHINode>(V) ||
140+
isa<DbgInfoIntrinsic>(V);
140141
};
141142
auto IsValidOperand = [] (const Value *V) -> bool {
142143
return isa<Constant>(V) || isa<Argument>(V) || isa<CallInst>(V) ||

llvm/lib/Transforms/AggressiveInstCombine/AggressiveInstCombine.cpp

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

722-
if (++NumScanned > MaxInstrsToScan)
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)
723725
return false;
724726
}
725727

llvm/lib/Transforms/IPO/IROutliner.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -717,6 +717,8 @@ 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+
720722
for (Instruction &Val : CurrBB) {
721723
// Since debug-info originates from many different locations in the
722724
// program, it will cause incorrect reporting from a debugger if we keep
@@ -747,12 +749,21 @@ static void moveFunctionData(Function &Old, Function &New,
747749
// From this point we are only handling call instructions.
748750
CallInst *CI = cast<CallInst>(&Val);
749751

752+
// Collect debug intrinsics for later removal.
753+
if (isa<DbgInfoIntrinsic>(CI)) {
754+
DebugInsts.push_back(&Val);
755+
continue;
756+
}
757+
750758
// Edit the scope of called functions inside of outlined functions.
751759
if (DISubprogram *SP = New.getSubprogram()) {
752760
DILocation *DI = DILocation::get(New.getContext(), 0, 0, SP);
753761
Val.setDebugLoc(DI);
754762
}
755763
}
764+
765+
for (Instruction *I : DebugInsts)
766+
I->eraseFromParent();
756767
}
757768
}
758769

llvm/lib/Transforms/IPO/SampleProfileProbe.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,8 @@ 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) && !J->isLifetimeStartOrEnd() && J->getDebugLoc();
388+
return !isa<PHINode>(J) && !isa<DbgInfoIntrinsic>(J) &&
389+
!J->isLifetimeStartOrEnd() && J->getDebugLoc();
389390
};
390391

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

llvm/lib/Transforms/InstCombine/InstructionCombining.cpp

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

4790-
// Re-point iterator to come after any debug-info records.
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
47914795
MoveBefore.setHeadBit(false);
47924796

47934797
bool Changed = false;
@@ -5578,9 +5582,11 @@ bool InstCombinerImpl::prepareWorklist(Function &F) {
55785582
continue;
55795583

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

5583-
MadeIRChange |= NumDeadInstInBB != 0;
5589+
MadeIRChange |= NumDeadInstInBB + NumDeadDbgInstInBB > 0;
55845590
NumDeadInst += NumDeadInstInBB;
55855591
}
55865592

llvm/lib/Transforms/Instrumentation/GCOVProfiling.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -583,6 +583,10 @@ 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+
586590
const DebugLoc &Loc = I.getDebugLoc();
587591
if (!Loc)
588592
continue;
@@ -870,6 +874,10 @@ bool GCOVProfiler::emitProfileNotes(
870874
}
871875

872876
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+
873881
const DebugLoc &Loc = I.getDebugLoc();
874882
if (!Loc)
875883
continue;

llvm/lib/Transforms/Instrumentation/ThreadSanitizer.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -527,7 +527,8 @@ 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<InvokeInst>(Inst)) {
530+
else if ((isa<CallInst>(Inst) && !isa<DbgInfoIntrinsic>(Inst)) ||
531+
isa<InvokeInst>(Inst)) {
531532
if (CallInst *CI = dyn_cast<CallInst>(&Inst))
532533
maybeMarkSanitizerLibraryCallNoBuiltin(CI, &TLI);
533534
if (isa<MemIntrinsic>(Inst))

llvm/lib/Transforms/Scalar/ADCE.cpp

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

565-
Changed.ChangedNonDebugInstr = true;
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+
}
566579

567580
// Prepare to delete.
568581
Worklist.push_back(&I);

llvm/lib/Transforms/Scalar/GVN.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2684,6 +2684,10 @@ bool GVNPass::propagateEquality(Value *LHS, Value *RHS,
26842684
/// When calculating availability, handle an instruction
26852685
/// by inserting it into the appropriate sets.
26862686
bool GVNPass::processInstruction(Instruction *I) {
2687+
// Ignore dbg info intrinsics.
2688+
if (isa<DbgInfoIntrinsic>(I))
2689+
return false;
2690+
26872691
// If the instruction can be easily simplified then do so now in preference
26882692
// to value numbering it. Value numbering often exposes redundancies, for
26892693
// example if it determines that %y is equal to %x then the instruction
@@ -2970,7 +2974,8 @@ bool GVNPass::performScalarPREInsertion(Instruction *Instr, BasicBlock *Pred,
29702974
bool GVNPass::performScalarPRE(Instruction *CurInst) {
29712975
if (isa<AllocaInst>(CurInst) || CurInst->isTerminator() ||
29722976
isa<PHINode>(CurInst) || CurInst->getType()->isVoidTy() ||
2973-
CurInst->mayReadFromMemory() || CurInst->mayHaveSideEffects())
2977+
CurInst->mayReadFromMemory() || CurInst->mayHaveSideEffects() ||
2978+
isa<DbgInfoIntrinsic>(CurInst))
29742979
return false;
29752980

29762981
// Don't do PRE on compares. The PHI would prevent CodeGenPrepare from

llvm/lib/Transforms/Scalar/GVNHoist.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1166,7 +1166,8 @@ std::pair<unsigned, unsigned> GVNHoist::hoistExpressions(Function &F) {
11661166
SI.insert(Store, VN);
11671167
else if (auto *Call = dyn_cast<CallInst>(&I1)) {
11681168
if (auto *Intr = dyn_cast<IntrinsicInst>(Call)) {
1169-
if (Intr->getIntrinsicID() == Intrinsic::assume ||
1169+
if (isa<DbgInfoIntrinsic>(Intr) ||
1170+
Intr->getIntrinsicID() == Intrinsic::assume ||
11701171
Intr->getIntrinsicID() == Intrinsic::sideeffect)
11711172
continue;
11721173
}

0 commit comments

Comments
 (0)