[all-commits] [llvm/llvm-project] e3cd49: [Assignment Tracking][21/*] Account for assignment...

Orlando Cazalet-Hyams via All-commits all-commits at lists.llvm.org
Fri Nov 18 03:56:51 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: e3cd498ff7748f967be1bdcc0a994e40ce82268f
      https://github.com/llvm/llvm-project/commit/e3cd498ff7748f967be1bdcc0a994e40ce82268f
  Author: OCHyams <orlando.hyams at sony.com>
  Date:   2022-11-18 (Fri, 18 Nov 2022)

  Changed paths:
    M llvm/lib/Transforms/Utils/CloneFunction.cpp
    M llvm/lib/Transforms/Utils/InlineFunction.cpp
    A llvm/test/DebugInfo/Generic/assignment-tracking/inline/id.ll
    A llvm/test/DebugInfo/Generic/assignment-tracking/inline/inline-stores.ll
    A llvm/test/DebugInfo/Generic/assignment-tracking/inline/use-before-def.ll

  Log Message:
  -----------
  [Assignment Tracking][21/*] Account for assignment tracking in inliner

The Assignment Tracking debug-info feature is outlined in this RFC:

https://discourse.llvm.org/t/
rfc-assignment-tracking-a-better-way-of-specifying-variable-locations-in-ir

The inliner requires two additions:

fixupAssignments - Update inlined instructions' DIAssignID metadata so that
inlined DIAssignID attachments are unique to the inlined instance.

trackInlinedStores - Treat inlined stores to caller-local variables
(i.e. callee stores to argument pointers that point to the caller's allocas) as
assignments. Track them using trackAssignments, which is the same method as is
used by the AssignmentTrackingPass. This means that we're able to detect stale
memory locations due to DSE after inlining. Because the stores are only tracked
_after_ inlining, any DSE or movement of stores _before_ inlining will not be
accounted for. This is an accepted limitation mentioned in the RFC.

One change is also required:

Update CloneBlock to preserve debug use-before-defs. Otherwise the assignments
will be dropped due to having the intrinsic operands replaced with empty
metadata (see use-before-def.ll in this patch and this related discourse post.

Reviewed By: jmorse

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




More information about the All-commits mailing list