[all-commits] [llvm/llvm-project] 38292f: [Assignment Tracking] Fix assertion in AssignmentT...

Orlando Cazalet-Hyams via All-commits all-commits at lists.llvm.org
Wed Apr 12 04:36:52 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 38292f0e1451ca4d4cde6759ab113d8eefed4d22
      https://github.com/llvm/llvm-project/commit/38292f0e1451ca4d4cde6759ab113d8eefed4d22
  Author: OCHyams <orlando.hyams at sony.com>
  Date:   2023-04-12 (Wed, 12 Apr 2023)

  Changed paths:
    M llvm/lib/IR/DebugInfo.cpp
    A llvm/test/DebugInfo/Generic/assignment-tracking/declare-to-assign/long-double-x87.ll

  Log Message:
  -----------
  [Assignment Tracking] Fix assertion in AssignmentTrackingPass::runOnFunction

The assertion exists to ensure all variables passed into `trackAssignments` end
up with dbg.assigns associated with their backing allocas. The assertion
compared the passed-in and tracked variables using `DebugVariable`, which
includes the fragment as part of the variable identity.

It is possible for the backing alloca to be smaller than a variable (see test
case). In this case the input variable `(Var X, no fragment, no InlinedAt)`
isn't equal to the dbg.assign variable `(Var X, some fragment, no
InlinedAt)`. To cover this case the assertion now ignores fragments through the
use of `DebugVariableAggregate`.

Reviewed By: jmorse

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


  Commit: 3820e9a2b29a2e268319ed6635da0d59e18d736d
      https://github.com/llvm/llvm-project/commit/3820e9a2b29a2e268319ed6635da0d59e18d736d
  Author: OCHyams <orlando.hyams at sony.com>
  Date:   2023-04-12 (Wed, 12 Apr 2023)

  Changed paths:
    M clang/include/clang/Driver/Options.td
    M clang/test/CodeGen/assignment-tracking/flag.cpp

  Log Message:
  -----------
  Reapply (4) "[Assignment Tracking] Enable by default"

Re-land D146987.

This reverts commit 8af575657b1dc1113640286b3649842c2473c2cf
which reverts D146987.


Compare: https://github.com/llvm/llvm-project/compare/ca7a20df1082...3820e9a2b29a


More information about the All-commits mailing list