[all-commits] [llvm/llvm-project] 3d7aa9: [DebugInfo][RemoveDIs] Use autoupgrader to convert...

Jeremy Morse via All-commits all-commits at lists.llvm.org
Wed Jun 11 05:56:51 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 3d7aa961ac96f83d2e28f107c6dfa5a6a279b364
      https://github.com/llvm/llvm-project/commit/3d7aa961ac96f83d2e28f107c6dfa5a6a279b364
  Author: Jeremy Morse <jeremy.morse at sony.com>
  Date:   2025-06-11 (Wed, 11 Jun 2025)

  Changed paths:
    M llvm/lib/AsmParser/LLParser.cpp
    M llvm/lib/IR/AsmWriter.cpp
    M llvm/lib/IR/AutoUpgrade.cpp
    M llvm/lib/IR/BasicBlock.cpp
    M llvm/lib/IR/Verifier.cpp
    M llvm/test/Assembler/drop-debug-info-nonzero-alloca.ll
    M llvm/test/DebugInfo/Generic/assignment-tracking/parse-and-verify/verify.ll
    M llvm/test/DebugInfo/Generic/sroa-extract-bits.ll
    M llvm/test/Transforms/IROutliner/outlining-debug-statements.ll
    M llvm/test/Transforms/ObjCARC/code-motion.ll
    A llvm/test/Verifier/RemoveDI/invalid-dbg-declare-operands.ll
    A llvm/test/Verifier/dbg-declare-invalid-debug-loc.ll
    M llvm/test/Verifier/diexpression-entry-value-llvm-ir.ll
    M llvm/test/Verifier/llvm.dbg.declare-address.ll
    M llvm/test/Verifier/llvm.dbg.declare-expression.ll
    M llvm/test/Verifier/llvm.dbg.declare-variable.ll
    M llvm/test/Verifier/llvm.dbg.intrinsic-dbg-attachment.ll
    M llvm/test/Verifier/llvm.dbg.value-expression.ll
    M llvm/test/Verifier/llvm.dbg.value-value.ll
    M llvm/test/Verifier/llvm.dbg.value-variable.ll
    M llvm/unittests/IR/DebugInfoTest.cpp

  Log Message:
  -----------
  [DebugInfo][RemoveDIs] Use autoupgrader to convert old debug-info (#143452)

By chance, two things have prevented the autoupgrade path being
exercised much so far:
 * LLParser setting the debug-info mode to "old" on seeing intrinsics,
* The test in AutoUpgrade.cpp wanting to upgrade into a "new" debug-info
block.

In practice, this appears to mean this code path hasn't seen the various
invalid inputs that can come its way. This commit does a number of
things:
* Tolerates the various illegal inputs that can be written with
debug-intrinsics, and that must be tolerated until the Verifier runs,
 * Printing illegal/null DbgRecord fields must succeed,
* Verifier errors need to localise the function/block where the error
is,
 * Tests that now see debug records will print debug-record errors,

Plus a few new tests for other intrinsic-to-debug-record failures modes
I found. There are also two edge cases:
* Some of the unit tests switch back and forth between intrinsic and
record modes at will; I've deleted coverage and some assertions to
tolerate this as intrinsic support is now Gone (TM),
* In sroa-extract-bits.ll, the order of debug records flips. This is
because the autoupgrader upgrades in the opposite order to the basic
block conversion routines... which doesn't change the record order, but
_does_ change the use list order in Metadata! This should (TM) have no
consequence to the correctness of LLVM, but will change the order of
various records and the order of DWARF record output too.

I tried to reduce this patch to a smaller collection of changes, but
they're all intertwined, sorry.



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