#
c862e612 |
| 24-Feb-2024 |
Jorge Gorbe Moya <jgorbe@google.com> |
Revert "[RemoveDIs] Enable DPLabels conversion [3b/3] (#82639)"
This reverts commit 71d47a0b00e9f48dc740556d7f452ffadf308731 because it causes clang to crash in some cases. See repro posted at https
Revert "[RemoveDIs] Enable DPLabels conversion [3b/3] (#82639)"
This reverts commit 71d47a0b00e9f48dc740556d7f452ffadf308731 because it causes clang to crash in some cases. See repro posted at https://github.com/llvm/llvm-project/commit/71d47a0b00e9f48dc740556d7f452ffadf308731
show more ...
|
#
71d47a0b |
| 23-Feb-2024 |
Orlando Cazalet-Hyams <orlando.hyams@sony.com> |
[RemoveDIs] Enable DPLabels conversion [3b/3] (#82639)
Enables conversion between llvm.dbg.label and DPLabel.
|
#
20434bf3 |
| 22-Feb-2024 |
Orlando Cazalet-Hyams <orlando.hyams@sony.com> |
[RemoveDIs][NFC] Add DPLabel class [2/3] (#82376)
Patch 2 of 3 to add llvm.dbg.label support to the RemoveDIs project. The
patch stack adds the DPLabel class, which is the RemoveDIs
llvm.dbg.label
[RemoveDIs][NFC] Add DPLabel class [2/3] (#82376)
Patch 2 of 3 to add llvm.dbg.label support to the RemoveDIs project. The
patch stack adds the DPLabel class, which is the RemoveDIs
llvm.dbg.label
equivalent.
1. Add DbgRecord base class for DPValue and the not-yet-added
DPLabel class.
-> 2. Add the DPLabel class.
3. Enable dbg.label conversion and add support to passes.
This will be used (and tested) in the final patch(es), coming next.
show more ...
|
Revision tags: llvmorg-18.1.0-rc3 |
|
#
4a23ab43 |
| 20-Feb-2024 |
Orlando Cazalet-Hyams <orlando.hyams@sony.com> |
Fix Wcovered-switch-default Werror after #78252
bot failure: https://lab.llvm.org/buildbot/#/builders/19/builds/24831
|
#
ababa964 |
| 20-Feb-2024 |
Orlando Cazalet-Hyams <orlando.hyams@sony.com> |
[RemoveDIs][NFC] Introduce DbgRecord base class [1/3] (#78252)
Patch 1 of 3 to add llvm.dbg.label support to the RemoveDIs project. The
patch stack adds a new base class
-> 1. Add DbgRecord
[RemoveDIs][NFC] Introduce DbgRecord base class [1/3] (#78252)
Patch 1 of 3 to add llvm.dbg.label support to the RemoveDIs project. The
patch stack adds a new base class
-> 1. Add DbgRecord base class for DPValue and the not-yet-added
DPLabel class.
2. Add the DPLabel class.
3. Enable dbg.label conversion and add support to passes.
Patches 1 and 2 are NFC.
In the near future we also will rename DPValue to DbgVariableRecord and
DPLabel to DbgLabelRecord, at which point we'll overhaul the function
names too. The name DPLabel keeps things consistent for now.
show more ...
|
#
6cb66ee5 |
| 07-Feb-2024 |
Stephen Tozer <stephen.tozer@sony.com> |
[RemoveDIs][DebugInfo] Handle RAUW from dead constants (#80837)
Ensure that when a constant value dies, all ValueAsMetadata uses of that
constant in a DebugValueUser will be replaced with a PoisonV
[RemoveDIs][DebugInfo] Handle RAUW from dead constants (#80837)
Ensure that when a constant value dies, all ValueAsMetadata uses of that
constant in a DebugValueUser will be replaced with a PoisonValue instead
of a nullptr. This has little visible effect currently, as any nullptr metadata
uses in a DebugValueUser would be converted to an empty MDNode in
the end anyway, but this patch adds an assert that would be triggered by
two existing tests without the functional component of this patch:
llvm/test/Transforms/Inline/delete-function-with-metadata-use.ll
llvm/test/DebugInfo/X86/array2.ll
show more ...
|
Revision tags: llvmorg-18.1.0-rc2 |
|
#
ddc49357 |
| 06-Feb-2024 |
Jeremy Morse <jeremy.morse@sony.com> |
[DebugInfo][RemoveDIs] Don't allocate one DPMarker per instruction (#79345)
This is an optimisation patch that shouldn't have any functional effect. There's no need for all instructions to have a DP
[DebugInfo][RemoveDIs] Don't allocate one DPMarker per instruction (#79345)
This is an optimisation patch that shouldn't have any functional effect. There's no need for all instructions to have a DPMarker attached to them, because not all instructions have adjacent DPValues (aka dbg.values).
This patch inserts the appropriate conditionals into functions like BasicBlock::spliceDebugInfo to ensure we don't step on a null pointer when there isn't a DPMarker allocated. Mostly, this is a case of calling createMarker occasionally, which will create a marker on an instruction if there isn't one there already.
Also folded into this is the use of adoptDbgValues, which is a natural extension: if we have a sequence of instructions and debug records:
%foo = add i32 %0,... # dbg_value { %foo, ... # dbg_value { %bar, ... %baz = add i32 %... %qux = add i32 %...
and delete, for example, the %baz instruction, then the dbg_value records would naturally be transferred onto the %qux instruction (they "fall down" onto it). There's no point in creating and splicing DPMarkers in the case shown when %qux doesn't have a DPMarker already, we can instead just change the owner of %baz's DPMarker from %baz to %qux. This also avoids calling setParent on every DPValue.
Update LoopRotationUtils: it was relying on each instruction having it's own distinct end(), so that we could express ranges and lack-of-ranges. That's no longer true though: so switch to storing the range of DPValues on the next instruction when we want to consider it's range next time around the loop (see the nearby comment).
show more ...
|
Revision tags: llvmorg-18.1.0-rc1 |
|
#
19b65a9c |
| 25-Jan-2024 |
Jeremy Morse <jeremy.morse@sony.com> |
[DebugInfo][RemoveDIs] Add a DPValue implementation for instcombine sinking (#77930)
In instcombine, when we sink an instruction into a successor block, we try
to clone and salvage all the variable
[DebugInfo][RemoveDIs] Add a DPValue implementation for instcombine sinking (#77930)
In instcombine, when we sink an instruction into a successor block, we try
to clone and salvage all the variable assignments that use that Value. This
is a behaviour that's (IMO) flawed, but there are important use cases where
we want to avoid regressions, thus we're implementing this for the
non-instruction debug-info representation.
This patch refactors the dbg.value sinking code into it's own function, and
installs a parallel implementation for DPValues, the non-instruction
debug-info container. This is mostly identical to the dbg.value
implementation, except that we don't have an easy-to-access ordering
between DPValues, and have to jump through extra hoops to establish one in
the (rare) cases where that ordering is required.
The test added represents a common use-case in LLVM where these behaviours
are important: a loop has been completely optimised away, leaving several
dbg.values in a row referring to an instruction that's going to sink. The
dbg.values should sink in both dbg.value and RemoveDIs mode, and
additionally only the last assignment should sink.
show more ...
|
Revision tags: llvmorg-19-init |
|
#
d499df02 |
| 16-Jan-2024 |
Stephen Tozer <stephen.tozer@sony.com> |
[RemoveDIs][DebugInfo] Add DPVAssign variant of DPValue (#77912)
This implements the DbgAssignIntrinsic class as a variant of DPValues -
unfortunately this involves increasing the size of the `Debu
[RemoveDIs][DebugInfo] Add DPVAssign variant of DPValue (#77912)
This implements the DbgAssignIntrinsic class as a variant of DPValues -
unfortunately this involves increasing the size of the `DebugValueUser`
storage by 3x, but this is necessary to enable assigns to be
represented, and can be offset in a future patch by splitting DPValue
into subclasses such that each variant can store only the fields it
needs. This patch does not actually create DPVAssigns in any case;
future patches will handle this variant in all cases where generic
DPValue handling does not. This patch also does not implement tracking
support for DIAssignIDs, which is necessary to find DPVAssigns that
reference a given DIAssignID; that is added in a subsequent patch.
show more ...
|
#
2b08de43 |
| 16-Jan-2024 |
Stephen Tozer <stephen.tozer@sony.com> |
[RemoveDIs][DebugInfo][NFC] Add Instruction and convenience functions to DPValue (#77896)
This patch adds a set of functions to the DPValue class that
conveniently perform some common operations, a
[RemoveDIs][DebugInfo][NFC] Add Instruction and convenience functions to DPValue (#77896)
This patch adds a set of functions to the DPValue class that
conveniently perform some common operations, and some that replicate
existing functions on `DbgVariableIntrinsic` and its subclasses.
show more ...
|
#
5457fab1 |
| 12-Dec-2023 |
OCHyams <orlando.hyams@sony.com> |
Reapply "[RemoveDIs][NFC] Find DPValues using findDbgDeclares (#73500)"
This patch doesn't change any call sites.
Depends on #73498.
Reverted in 87c686700f68ce24191f027082ef5fb9a654e9d8.
|
#
4648acbb |
| 11-Dec-2023 |
Orlando Cazalet-Hyams <orlando.hyams@sony.com> |
[NFC][RemoveDIs] Add LocationType parameter to DPValue ctor (#74091)
We can tidy up the interfaces a bit once all intrinsics are supported, as we
will have a more informed view then.
|
#
2ec0283c |
| 30-Nov-2023 |
Jeremy Morse <jeremy.morse@sony.com> |
[DebugInfo][RemoveDIs] Emulate inserting insts in dbg.value sequences (#73350)
Here's a problem for the RemoveDIs project to make debug-info not be
stored in instructions -- in the following sequen
[DebugInfo][RemoveDIs] Emulate inserting insts in dbg.value sequences (#73350)
Here's a problem for the RemoveDIs project to make debug-info not be
stored in instructions -- in the following sequence:
dbg.value(foo
%bar = add i32 ...
dbg.value(baz
It's possible for rare passes (only CodeGenPrepare) to remove the add
instruction, and then re-insert it back in the same place. When
debug-info is stored in instructions and there's a total order on "when"
things happen this is easy, but by moving that information out of the
instruction stream we start having to do manual maintenance.
This patch adds some utilities for re-inserting an instruction into a
sequence of DPValue objects. Someday we hope to design this away, but
for now it's necessary to support all the things you can do with
dbg.values. The two unit tests show how DPValues get shuffled around
using the relevant function calls. A follow-up patch adds
instrumentation to CodeGenPrepare.
show more ...
|
Revision tags: llvmorg-17.0.6, llvmorg-17.0.5 |
|
#
b002b38f |
| 09-Nov-2023 |
Jeremy Morse <jeremy.morse@sony.com> |
[DebugInfo][RemoveDIs] Add new behind-the-scenes plumbing for debug-info
This is the "central" patch to the removing-debug-intrinsics project: it changes the instruction movement APIs (insert, move,
[DebugInfo][RemoveDIs] Add new behind-the-scenes plumbing for debug-info
This is the "central" patch to the removing-debug-intrinsics project: it changes the instruction movement APIs (insert, move, splice) to interpret the "Head" bits we're attaching to BasicBlock::iterators, and updates debug-info records in the background to preserve the ordering of debug-info (which is in DPValue objects instead of dbg.values). The cost is the complexity of this patch, plus memory. The benefit is that LLVM developers can cease thinking about whether they're moving debug-info or not, because it'll happen behind the scenes.
All that complexity appears in BasicBlock::spliceDebugInfo, see the diagram there for how we now manually shuffle debug-info around. Each potential splice configuration gets tested in the added unit tests.
The rest of this patch applies the same reasoning in a variety of scenarios. When moveBefore (and it's siblings) are used to move instructions around, the caller has to indicate whether they intend for debug-info to move too (is it a "Preserving" call or not), and then the "Head" bits used to determine where debug-info moves to. Similar reasoning is needed for insertBefore.
Differential Revision: https://reviews.llvm.org/D154353
show more ...
|
#
b90cba10 |
| 09-Nov-2023 |
Jeremy Morse <jeremy.morse@sony.com> |
[NFC][RemoveDIs] Shuffle header inclusions for "new" debug-info
BasicBlock.h and Instruction.h will eventually need to include DebugProgramInstruction.h so that debug-info attached to instructions c
[NFC][RemoveDIs] Shuffle header inclusions for "new" debug-info
BasicBlock.h and Instruction.h will eventually need to include DebugProgramInstruction.h so that debug-info attached to instructions can be enumerated and cloned. Originally including it made compiling clang much slower, I think I've pinned that down as being the inclusion of DebugInfoMetadata.h causing ~every LLVM translation unit to parse all the debug-info classes.
This patch avoids that by shifting some functions into the cpp file rather than the header, and restores the inclusion of DebugProgramInstruction.h in BasicBlock.h so that the rest of the RemoveDIs functionality can land.
show more ...
|
#
f1b0a544 |
| 08-Nov-2023 |
Jeremy Morse <jeremy.morse@sony.com> |
Reapply 7d77bbef4ad92, adding new debug-info classes
This reverts commit 957efa4ce4f0391147cec62746e997226ee2b836.
Original commit message below -- in this follow up, I've shifted un-necessary incl
Reapply 7d77bbef4ad92, adding new debug-info classes
This reverts commit 957efa4ce4f0391147cec62746e997226ee2b836.
Original commit message below -- in this follow up, I've shifted un-necessary inclusions of DebugProgramInstruction.h into being forward declarations (fixes clang-compile time I hope), and a memory leak in the DebugInfoTest.cpp IR unittests.
I also tracked a compile-time regression in D154080, more explanation there, but the result of which is hiding some of the changes behind the EXPERIMENTAL_DEBUGINFO_ITERATORS compile-time flag. This is tested by the "new-debug-iterators" buildbot.
[DebugInfo][RemoveDIs] Add prototype storage classes for "new" debug-info
This patch adds a variety of classes needed to record variable location debug-info without using the existing intrinsic approach, see the rationale at [0].
The two added files and corresponding unit tests are the majority of the plumbing required for this, but at this point isn't accessible from the rest of LLVM as we need to stage it into the repo gently. An overview is that classes are added for recording variable information attached to Real (TM) instructions, in the form of DPValues and DPMarker objects. The metadata-uses of DPValues is plumbed into the metadata hierachy, and a field added to class Instruction, which are all stimulated in the unit tests. The next few patches in this series add utilities to convert to/from this new debug-info format and add instruction/block utilities to have debug-info automatically updated in the background when various operations occur.
This patch was reviewed in Phab in D153990 and D154080, I've squashed them together into this commit as there are dependencies between the two patches, and there's little profit in landing them separately.
[0] https://discourse.llvm.org/t/rfc-instruction-api-changes-needed-to-eliminate-debug-intrinsics-from-ir/68939
show more ...
|
#
d97b2b38 |
| 02-Nov-2023 |
Jie Fu <jiefu@tencent.com> |
[DebugInfo] Fix -Wunused-variable in DebugProgramInstruction.cpp (NFC)
/llvm-project/llvm/lib/IR/DebugProgramInstruction.cpp:163:18: error: unused variable 'Unit' [-Werror,-Wunused-variable] DICom
[DebugInfo] Fix -Wunused-variable in DebugProgramInstruction.cpp (NFC)
/llvm-project/llvm/lib/IR/DebugProgramInstruction.cpp:163:18: error: unused variable 'Unit' [-Werror,-Wunused-variable] DICompileUnit *Unit = ^ 1 error generated.
show more ...
|
#
7d77bbef |
| 02-Nov-2023 |
Jeremy Morse <jeremy.morse@sony.com> |
[DebugInfo][RemoveDIs] Add prototype storage classes for "new" debug-info
This patch adds a variety of classes needed to record variable location debug-info without using the existing intrinsic appr
[DebugInfo][RemoveDIs] Add prototype storage classes for "new" debug-info
This patch adds a variety of classes needed to record variable location debug-info without using the existing intrinsic approach, see the rationale at [0].
The two added files and corresponding unit tests are the majority of the plumbing required for this, but at this point isn't accessible from the rest of LLVM as we need to stage it into the repo gently. An overview is that classes are added for recording variable information attached to Real (TM) instructions, in the form of DPValues and DPMarker objects. The metadata-uses of DPValues is plumbed into the metadata hierachy, and a field added to class Instruction, which are all stimulated in the unit tests. The next few patches in this series add utilities to convert to/from this new debug-info format and add instruction/block utilities to have debug-info automatically updated in the background when various operations occur.
This patch was reviewed in Phab in D153990 and D154080, I've squashed them together into this commit as there are dependencies between the two patches, and there's little profit in landing them separately.
[0] https://discourse.llvm.org/t/rfc-instruction-api-changes-needed-to-eliminate-debug-intrinsics-from-ir/68939
show more ...
|