History log of /llvm-project/llvm/lib/Transforms/Utils/Debugify.cpp (Results 1 – 25 of 54)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
Revision tags: llvmorg-21-init, llvmorg-19.1.7, llvmorg-19.1.6, llvmorg-19.1.5, llvmorg-19.1.4, llvmorg-19.1.3, llvmorg-19.1.2, llvmorg-19.1.1
# e03f4271 19-Sep-2024 Jay Foad <jay.foad@amd.com>

[LLVM] Use {} instead of std::nullopt to initialize empty ArrayRef (#109133)

It is almost always simpler to use {} instead of std::nullopt to
initialize an empty ArrayRef. This patch changes all oc

[LLVM] Use {} instead of std::nullopt to initialize empty ArrayRef (#109133)

It is almost always simpler to use {} instead of std::nullopt to
initialize an empty ArrayRef. This patch changes all occurrences I could
find in LLVM itself. In future the ArrayRef(std::nullopt_t) constructor
could be deprecated or removed.

show more ...


Revision tags: llvmorg-19.1.0, llvmorg-19.1.0-rc4, llvmorg-19.1.0-rc3, llvmorg-19.1.0-rc2, llvmorg-19.1.0-rc1, llvmorg-20-init, llvmorg-18.1.8, llvmorg-18.1.7, llvmorg-18.1.6, llvmorg-18.1.5, llvmorg-18.1.4
# 1c6b0f77 16-Apr-2024 Stephen Tozer <stephen.tozer@sony.com>

[RemoveDI] Add support for debug records to debugify (#87383)

This patch changes debugify to support debug variable records, and
subsequently to no longer convert modules automatically to intrinsic

[RemoveDI] Add support for debug records to debugify (#87383)

This patch changes debugify to support debug variable records, and
subsequently to no longer convert modules automatically to intrinsics
when entering debugify.

show more ...


Revision tags: llvmorg-18.1.3, llvmorg-18.1.2, llvmorg-18.1.1, llvmorg-18.1.0, llvmorg-18.1.0-rc4, llvmorg-18.1.0-rc3, llvmorg-18.1.0-rc2
# a4531108 06-Feb-2024 Jeremy Morse <jeremy.morse@sony.com>

[DebugInfo][RemoveDIs] Extend intrinsic-conversion in debugify (#80861)

A while back the entry/exit points of debugify were instrumented with
conversion functions to/from non-intrinsic-form debug-i

[DebugInfo][RemoveDIs] Extend intrinsic-conversion in debugify (#80861)

A while back the entry/exit points of debugify were instrumented with
conversion functions to/from non-intrinsic-form debug-info. This is the
path of least resistance to incrementally converting parts of LLVM to
use the new format. However, it turns out that debugify registers
callbacks with the pass manager and can be fed non-intrinsic form
debug-info. Thus: this patch wraps each of the four major debugify
functions with the convertion utilities, and extends test coverage to a
test that exposes this problem.

(An alternative would be to put this code in the callback lambdas, but
then it would be fighting pass manager abstractions of what type the IR
has).

Handily debugify has been designed to record the /meaning/ of debug-info
rather than take pointers to intrinsics and the like, so the storage
mechanism for debug-info is transparent to it!

show more ...


Revision tags: llvmorg-18.1.0-rc1, llvmorg-19-init
# d2d9dc8e 29-Nov-2023 Jeremy Morse <jeremy.morse@sony.com>

[DebugInfo][RemoveDIs] Make debugify pass convert to/from RemoveDIs mode (#73251)

Debugify is extremely useful as a testing and debugging tool, and a good
number of LLVM-IR transform tests use it.

[DebugInfo][RemoveDIs] Make debugify pass convert to/from RemoveDIs mode (#73251)

Debugify is extremely useful as a testing and debugging tool, and a good
number of LLVM-IR transform tests use it. We need it to support "new"
non-instruction debug-info to get test coverage, but it's not important
enough to completely convert right now (and it'd be a large
undertaking). Thus: convert to/from dbg.value/DPValue mode on entry and
exit of the pass, which gives us the functionality without any further
work. The cost is compile-time, but again this is only happening during
tests.

Tested by: the large set of debugify tests enabled here. Note the
InstCombine test (cast-mul-select.ll) that hasn't been fully enabled:
this is because there's a debug-info sinking piece of code there that
hasn't been instrumented.

show more ...


Revision tags: llvmorg-17.0.6, llvmorg-17.0.5, llvmorg-17.0.4, llvmorg-17.0.3, llvmorg-17.0.2, llvmorg-17.0.1, llvmorg-17.0.0
# f8a1c8b7 07-Sep-2023 kazutakahirata <57370056+kazutakahirata@users.noreply.github.com>

[llvm] Use llvm::any_cast instead of any_cast (NFC) (#65565)

This patch replaces any_cast with llvm::any_cast. This in turn allows us
to gracefully switch to std::any in future by forwarding llvm::

[llvm] Use llvm::any_cast instead of any_cast (NFC) (#65565)

This patch replaces any_cast with llvm::any_cast. This in turn allows us
to gracefully switch to std::any in future by forwarding llvm::Any and
llvm::any_cast to:

using Any = std::any;

template <class T> T *any_cast(Any *Value) {
return std::any_cast<T>(Value);
}

respectively.

Without this patch, it's ambiguous whether any_cast refers to
std::any_cast or llvm::any_cast.

As an added bonus, this patch makes it easier to mechanically replace
llvm::any_cast with std::any_cast without affecting other occurrences of
any_cast (e.g. in libcxx).

show more ...


Revision tags: llvmorg-17.0.0-rc4, llvmorg-17.0.0-rc3, llvmorg-17.0.0-rc2, llvmorg-17.0.0-rc1, llvmorg-18-init, llvmorg-16.0.6, llvmorg-16.0.5, llvmorg-16.0.4, llvmorg-16.0.3, llvmorg-16.0.2, llvmorg-16.0.1, llvmorg-16.0.0
# 4c8ee1ac 16-Mar-2023 Arthur Eubanks <aeubanks@google.com>

[Debugify] Use ModuleAnalysisManager in instrumentation

In preparation for doing module checks of PreservedAnalyses.


# e94b59ee 15-Mar-2023 Arthur Eubanks <aeubanks@google.com>

[Debugify/Strip] Fix returned PreservedAnalyses


# 6d7da41b 15-Mar-2023 Arthur Eubanks <aeubanks@google.com>

[Debugify] Invalidate function analyses

Since debugify inserts instructions.


Revision tags: llvmorg-16.0.0-rc4, llvmorg-16.0.0-rc3, llvmorg-16.0.0-rc2, llvmorg-16.0.0-rc1, llvmorg-17-init, llvmorg-15.0.7
# 04210749 06-Jan-2023 OCHyams <orlando.hyams@sony.com>

[DebugInfo][NFC] Rename is/setUndef to is/setKilllocation

These names better reflect the semantics and also the implementation, since
it's not just "undef" operands that are sentinels used to signal

[DebugInfo][NFC] Rename is/setUndef to is/setKilllocation

These names better reflect the semantics and also the implementation, since
it's not just "undef" operands that are sentinels used to signal that the debug
intrinsic terminates dominating locations definitions.

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

Reviewed By: StephenTozer

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

show more ...


# bb7940e2 20-Dec-2022 Sebastian Neubauer <Sebastian.Neubauer@amd.com>

[llvm] Make llvm::Any similar to std::any

This facilitates replacing llvm::Any with std::any.
- Deprecate any_isa in favor of using any_cast(Any*) and checking for
nullptr because C++17 has no any

[llvm] Make llvm::Any similar to std::any

This facilitates replacing llvm::Any with std::any.
- Deprecate any_isa in favor of using any_cast(Any*) and checking for
nullptr because C++17 has no any_isa.
- Remove the assert from any_cast(Any*), so it returns nullptr if the
type is not correct. This aligns it with std::any_cast(any*).

Use any_cast(Any*) throughout LLVM instead of checks with any_isa.

This is the first part outlined in
https://discourse.llvm.org/t/rfc-switching-from-llvm-any-to-std-any/67176

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

show more ...


# 19158eb7 08-Dec-2022 Sebastian Neubauer <Sebastian.Neubauer@amd.com>

Revert "[llvm] Replace llvm::Any with std::any"

msvc fails to link when using any_cast. This seems to be fixed recently
only.

https://developercommunity.visualstudio.com/t/stdany-doesnt-link-when-e

Revert "[llvm] Replace llvm::Any with std::any"

msvc fails to link when using any_cast. This seems to be fixed recently
only.

https://developercommunity.visualstudio.com/t/stdany-doesnt-link-when-exceptions-are-disabled/376072

This reverts commit aeac2e4884a3ce62c920cd51806a9396da64d9f7.

show more ...


# aeac2e48 08-Dec-2022 Sebastian Neubauer <Sebastian.Neubauer@amd.com>

[llvm] Replace llvm::Any with std::any

llvm::Any had several bugs in the past, due to being sensitive to symbol
visibility. (See D101972 and D108943)

Even with these fixes applied, I still encounte

[llvm] Replace llvm::Any with std::any

llvm::Any had several bugs in the past, due to being sensitive to symbol
visibility. (See D101972 and D108943)

Even with these fixes applied, I still encounter the same issue on
Windows.

Similar to llvm::Optional going away in favor of std::optional, we can
use std::any from C++17.

Using std::any fixes the problem and puts the burden to do it correctly
on the standard library.

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

show more ...


# 0ca43d44 03-Dec-2022 Krzysztof Parzyszek <kparzysz@quicinc.com>

DebugInfoMetadata: convert Optional to std::optional


# 343de685 03-Dec-2022 Kazu Hirata <kazu@google.com>

[Transforms] Use std::nullopt instead of None (NFC)

This patch mechanically replaces None with std::nullopt where the
compiler would warn if None were deprecated. The intent is to reduce
the amount

[Transforms] Use std::nullopt instead of None (NFC)

This patch mechanically replaces None with std::nullopt where the
compiler would warn if None were deprecated. The intent is to reduce
the amount of manual work required in migrating from Optional to
std::optional.

This is part of an effort to migrate from llvm::Optional to
std::optional:

https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716

show more ...


Revision tags: llvmorg-15.0.6
# 9ee8d2e0 21-Nov-2022 Anton Sidorenko <anton.sidorenko@syntacore.com>

[Debugify] Strip llvm.mir.debugify metadata

We don't strip llvm.mir.debugify metadata in `llvm::stripDebugifyMetadata`. This
may lead to incorrect number of lines and variables in the metadata when

[Debugify] Strip llvm.mir.debugify metadata

We don't strip llvm.mir.debugify metadata in `llvm::stripDebugifyMetadata`. This
may lead to incorrect number of lines and variables in the metadata when we run
debugify twice, e.g. -run-pass=mir-debugify,...,mir-strip-debug,...,mir-debugify.

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

show more ...


Revision tags: llvmorg-15.0.5, llvmorg-15.0.4, llvmorg-15.0.3, working, llvmorg-15.0.2
# b5d28f3e 28-Sep-2022 Nikola Tesic <nikola.tesic@syrmia.com>

[Debugify][OriginalDIMode] Make HTML reporting infrastructure more resilient

Debugify in OriginalDebugInfo mode (verify-each-debuginfo-preserve), when used
in parallel builds of large projects, can

[Debugify][OriginalDIMode] Make HTML reporting infrastructure more resilient

Debugify in OriginalDebugInfo mode (verify-each-debuginfo-preserve), when used
in parallel builds of large projects, can produce incorrect report. More
precisely, simultaneous writes to JSON report file, could form incorrect JSON
objects, which describe found Debug Info bugs.
This patch uses the lock/unlock mechanism to protect JSON report file and also
makes script llvm/utils/llvm-original-di-preservation.py resilient to corrupted
lines in the report file. So, it ensures the creation of HTML report.

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

show more ...


Revision tags: llvmorg-15.0.1, llvmorg-15.0.0, llvmorg-15.0.0-rc3, llvmorg-15.0.0-rc2, llvmorg-15.0.0-rc1, llvmorg-16-init
# b5b6d3a4 06-Jul-2022 Nikola Tesic <nikola.tesic@syrmia.com>

[Debugify] Port verify-debuginfo-preserve to NewPM

Debugify in OriginalDebugInfo mode, introduced with D82545,
runs only with legacy PassManager.

This patch enables this utility for the NewPM.

Dif

[Debugify] Port verify-debuginfo-preserve to NewPM

Debugify in OriginalDebugInfo mode, introduced with D82545,
runs only with legacy PassManager.

This patch enables this utility for the NewPM.

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

show more ...


Revision tags: llvmorg-14.0.6, llvmorg-14.0.5, llvmorg-14.0.4, llvmorg-14.0.3, llvmorg-14.0.2
# c5600aef 21-Apr-2022 Nikola Tesic <nikola.tesic@syrmia.com>

[Debugify] Limit number of processed functions for original mode

Debugify in OriginalDebugInfo mode, does (DebugInfo) collect-before-pass & check-after-pass
for each instruction, which is pretty exp

[Debugify] Limit number of processed functions for original mode

Debugify in OriginalDebugInfo mode, does (DebugInfo) collect-before-pass & check-after-pass
for each instruction, which is pretty expensive. When used to analyze DebugInfo losses
in large projects (like LLVM), this raises the build time unacceptably.
This patch introduces a limit for the number of processed functions per compile unit.
By default, the limit is set to UINT_MAX (practically unlimited), and by using the introduced
option -debugify-func-limit the limit could be set to any positive integer number.

Differential revision: https://reviews.llvm.org/D115714

show more ...


Revision tags: llvmorg-14.0.1
# 1a943923 25-Mar-2022 Simon Pilgrim <llvm-dev@redking.me.uk>

[Utils] stripDebugifyMetadata - use cast<> instead of dyn_cast_or_null<> to avoid dereference of nullptr

The pointer is dereferenced immediately, so assert the cast is correct instead of returning n

[Utils] stripDebugifyMetadata - use cast<> instead of dyn_cast_or_null<> to avoid dereference of nullptr

The pointer is dereferenced immediately, so assert the cast is correct instead of returning nullptr

show more ...


# 91ea2470 22-Mar-2022 Djordje Todorovic <djordje.todorovic@syrmia.com>

[Debugify] Use DebugifyLevel in Debugify original mode

Before this patch the DebugifyLevel option was used for
the synthetic mode, so after this, it will be used in
the original mode as well.

Diffe

[Debugify] Use DebugifyLevel in Debugify original mode

Before this patch the DebugifyLevel option was used for
the synthetic mode, so after this, it will be used in
the original mode as well.

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

show more ...


# 73777b4c 22-Mar-2022 Djordje Todorovic <djordje.todorovic@syrmia.com>

[Debugify] Optimize debugify original mode

Before we start addressing the issue with having
a lot of false positives when using debugify in
the original mode, we have made a few patches that
should

[Debugify] Optimize debugify original mode

Before we start addressing the issue with having
a lot of false positives when using debugify in
the original mode, we have made a few patches that
should speed up the execution of the testing
utility Passes.

For example, when testing a large project
(let's say LLVM project itself), we can face
a lot of potential DI issues. Usually, we use
-verify-each-debuginfo-preserve (that is very
similar to -debugify-each) -- it collects
DI metadata before each Pass, and after the Pass
it checks if the Pass preserved the DI metadata.
However, we can speed up this process, since we
don't need to collect DI metadata before each
Pass -- we could use the DI metadata that are
collected after the previous Pass from
the pipeline as an input for the next Pass.

This patch speeds up the utility for ~2x.

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

show more ...


Revision tags: llvmorg-14.0.0, llvmorg-14.0.0-rc4, llvmorg-14.0.0-rc3, llvmorg-14.0.0-rc2, llvmorg-14.0.0-rc1, llvmorg-15-init, llvmorg-13.0.1, llvmorg-13.0.1-rc3, llvmorg-13.0.1-rc2
# 93615b88 21-Dec-2021 Djordje Todorovic <djordje.todorovic@syrmia.com>

[Debugify] Use WeakWH map collected before Pass when checking loc drop

This fixes a typo/bug when checking for pointer reuse when testing
DI location preservation in the Debugify original mode (when

[Debugify] Use WeakWH map collected before Pass when checking loc drop

This fixes a typo/bug when checking for pointer reuse when testing
DI location preservation in the Debugify original mode (when
checking -g generated Debug Info).

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

show more ...


Revision tags: llvmorg-13.0.1-rc1
# f8dfc352 29-Sep-2021 Djordje Todorovic <djordje.todorovic@syrmia.com>

NFC: [Debugify] Fix a typo when checking variables in the original mode


Revision tags: llvmorg-13.0.0, llvmorg-13.0.0-rc4, llvmorg-13.0.0-rc3, llvmorg-13.0.0-rc2, llvmorg-13.0.0-rc1, llvmorg-14-init, llvmorg-12.0.1, llvmorg-12.0.1-rc4, llvmorg-12.0.1-rc3, llvmorg-12.0.1-rc2, llvmorg-12.0.1-rc1
# b9076d11 21-May-2021 Djordje Todorovic <djordje.todorovic@syrmia.com>

Recommit: "[Debugify][Original DI] Test dbg var loc preservation""

[Debugify][Original DI] Test dbg var loc preservation

This is an improvement of [0]. This adds checking of
original ll

Recommit: "[Debugify][Original DI] Test dbg var loc preservation""

[Debugify][Original DI] Test dbg var loc preservation

This is an improvement of [0]. This adds checking of
original llvm.dbg.values()/declares() instructions in
optimizations.

We have picked a real issue that has been found with
this (actually, picked one variable location missing
from [1] and resolved the issue), and the result is
the fix for that -- D100844.

Before applying the D100844, using the options from [0]
(but with this patch applied) on the compilation of GDB 7.11,
the final HTML report for the debug-info issues can be found
at [1] (please scroll down, and look for
"Summary of Variable Location Bugs"). After applying
the D100844, the numbers has improved a bit -- please take
a look into [2].

[0] https://llvm.org/docs/HowToUpdateDebugInfo.html#\
test-original-debug-info-preservation-in-optimizations
[1] https://djolertrk.github.io/di-check-before-adce-fix/
[2] https://djolertrk.github.io/di-check-after-adce-fix/

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

The Unit test was failing because the pass from the test that
modifies the IR, in its runOnFunction() didn't return 'true',
so the expensive-check configuration triggered an assertion.

show more ...


# 0ae3c1d4 20-May-2021 Djordje Todorovic <djordje.todorovic@syrmia.com>

Revert "[Debugify][Original DI] Test dbg var loc preservation"

This reverts commit 76f375f3d9d6902820ffc21200e454926748c678.

This will be pushed again, after investigating a test failure:
https://l

Revert "[Debugify][Original DI] Test dbg var loc preservation"

This reverts commit 76f375f3d9d6902820ffc21200e454926748c678.

This will be pushed again, after investigating a test failure:
https://lab.llvm.org/buildbot/#/builders/16/builds/11254

show more ...


123