[all-commits] [llvm/llvm-project] 40d649: [DebugInfo] Transfer strcmp DILocation to generate...

Stephen Tozer via All-commits all-commits at lists.llvm.org
Mon Sep 23 07:40:06 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 40d6497a97a61ef5ea38e615cc324104cb34072a
      https://github.com/llvm/llvm-project/commit/40d6497a97a61ef5ea38e615cc324104cb34072a
  Author: Stephen Tozer <stephen.tozer at sony.com>
  Date:   2024-09-23 (Mon, 23 Sep 2024)

  Changed paths:
    M llvm/lib/Transforms/AggressiveInstCombine/AggressiveInstCombine.cpp
    A llvm/test/Transforms/AggressiveInstCombine/inline-strcmp-debugloc.ll

  Log Message:
  -----------
  [DebugInfo] Transfer strcmp DILocation to generated inline code (#108531)

When AggressiveInstCombine inlines a strcmp call, we currently copy the
strcmp's DILocation only to the br instruction that jumps to the inline
code. While this is roughly analogous to the original call, it leaves
the generated code without any source location, which is precarious for
a memory operation. This patch copies the strcmp call's DILocation to
all the generated code.

An alternative solution would be to generate a new DILocation with a
line 0 location and an inlinedAt pointing to the original call location,
but this would still give limited attribution to the generated code
without traversing the DIE, whereas the submitted solution allows
attribution with just the line table; even though it would be
technically more accurate, pragmatically I believe that copying the
call's location will be more useful for users.



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