[all-commits] [llvm/llvm-project] 1e6fe6: [DebugInfo] Print empty MDTuples wrapped in Metada...

Orlando Cazalet-Hyams via All-commits all-commits at lists.llvm.org
Tue Apr 25 06:14:16 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 1e6fe677f8aa98518e05218affa16e468819f5ed
      https://github.com/llvm/llvm-project/commit/1e6fe677f8aa98518e05218affa16e468819f5ed
  Author: OCHyams <orlando.hyams at sony.com>
  Date:   2023-04-25 (Tue, 25 Apr 2023)

  Changed paths:
    M llvm/lib/IR/AsmWriter.cpp
    A llvm/test/DebugInfo/Generic/empty-metadata-roundtrip.ll
    M llvm/test/Transforms/GlobalOpt/localize-constexpr-debuginfo.ll
    M llvm/test/Transforms/GlobalOpt/metadata.ll
    M llvm/test/Transforms/LoopIdiom/debug-line.ll
    M llvm/unittests/IR/MetadataTest.cpp

  Log Message:
  -----------
  [DebugInfo] Print empty MDTuples wrapped in MetadataAsValue inline

This improves the readability of debugging intrinsics. Instead of:

    call void @llvm.dbg.value(metadata !2, ...)
    !2 = !{}

We will see:

    call void @llvm.dbg.value(metadata !{}, ...)
    !2 = !{}

Note that we still get a numbered metadata entry for the node even if it's not
used elsewhere. This is to avoid adding more context to the print functions.

This is already legal IR - LLVM can parse and understand it - so there is no
need to update the parser.

The next patches in this stack will make such empty metadata operands more
common and semantically important.

Related to https://discourse.llvm.org/t/auto-undef-debug-uses-of-a-deleted-value

Reviewed By: StephenTozer

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




More information about the All-commits mailing list