[all-commits] [llvm/llvm-project] 903cf1: [InstCombine] Drop debug loc in TryToSinkInstruction

Vedant Kumar via All-commits all-commits at lists.llvm.org
Fri Jun 26 13:23:43 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 903cf140d0118cf0d3f0f6f8967c6a20d9c5be6b
      https://github.com/llvm/llvm-project/commit/903cf140d0118cf0d3f0f6f8967c6a20d9c5be6b
  Author: Vedant Kumar <vsk at apple.com>
  Date:   2020-06-26 (Fri, 26 Jun 2020)

  Changed paths:
    M llvm/lib/Transforms/InstCombine/InstructionCombining.cpp
    A llvm/test/Transforms/InstCombine/sink_to_unreachable_dbg.ll

  Log Message:
  -----------
  [InstCombine] Drop debug loc in TryToSinkInstruction

Summary:
The advice in HowToUpdateDebugInfo.rst is to "... preserve the debug
location of an instruction if the instruction either remains in its
basic block, or if its basic block is folded into a predecessor that
branches unconditionally".

TryToSinkInstruction doesn't seem to satisfy the criteria as it's
sinking an instruction to some successor block. Preserving the debug loc
can make single-stepping appear to go backwards, or make a breakpoint
hit on that location happen "too late" (since single-stepping from that
breakpoint can cause the function to return unexpectedly).

So, drop the debug location.

Reviewers: aprantl, davide

Subscribers: hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D82487




More information about the All-commits mailing list