Skip to content

Commit 3d52b1e

Browse files
committed
Revert "[InstCombine] Drop debug loc in TryToSinkInstruction (reland)"
This reverts commit 9649c20. See discussion on the llvm-commits thread: if it's OK to preserve the location when sinking a call, it's probably OK to always preserve the location.
1 parent 528a1c5 commit 3d52b1e

File tree

2 files changed

+0
-52
lines changed

2 files changed

+0
-52
lines changed

llvm/lib/Transforms/InstCombine/InstructionCombining.cpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3356,12 +3356,6 @@ static bool TryToSinkInstruction(Instruction *I, BasicBlock *DestBlock) {
33563356
I->moveBefore(&*InsertPos);
33573357
++NumSunkInst;
33583358

3359-
// Drop the debug loc of non-inlinable instructions. This prevents
3360-
// single-stepping from going backwards. See HowToUpdateDebugInfo.rst for
3361-
// the full rationale.
3362-
if (!isa<CallBase>(I))
3363-
I->setDebugLoc(DebugLoc());
3364-
33653359
// Also sink all related debug uses from the source basic block. Otherwise we
33663360
// get debug use before the def. Attempt to salvage debug uses first, to
33673361
// maximise the range variables have location for. If we cannot salvage, then

llvm/test/Transforms/InstCombine/sink_to_unreachable_dbg.ll

Lines changed: 0 additions & 46 deletions
This file was deleted.

0 commit comments

Comments
 (0)