[all-commits] [llvm/llvm-project] caa265: [DebugInfo][InstCombine] Do not overwrite prior DI...

Stephen Tozer via All-commits all-commits at lists.llvm.org
Thu Oct 3 09:09:07 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: caa265e01cfc943752ff2c4da61a4ccc161938a1
      https://github.com/llvm/llvm-project/commit/caa265e01cfc943752ff2c4da61a4ccc161938a1
  Author: Stephen Tozer <stephen.tozer at sony.com>
  Date:   2024-10-03 (Thu, 03 Oct 2024)

  Changed paths:
    M llvm/lib/Transforms/InstCombine/InstructionCombining.cpp
    A llvm/test/Transforms/InstCombine/new-inst-dbgloc-overwrite.ll

  Log Message:
  -----------
  [DebugInfo][InstCombine] Do not overwrite prior DILocation for new Insts (#108565)

When InstCombine replaces an old instruction with a new instruction, it
copies !dbg and !annotation metadata from old to new. For some
InstCombine patterns we set a specific DILocation on the new instruction
prior to insertion, however, which more accurately reflects the new
instruction. This more specific DILocation may be overwritten on
insertion by a less appropriate one, resulting in a less correct line
mapping. This patch changes this behaviour to only copy the DILocation
from old to new if the new instruction has no existing DILocation (which
will always be the case for a new instruction unless InstCombine has
specifically set one).



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list