History log of /llvm-project/llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.cpp (Results 126 – 150 of 161)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# 708cbda5 17-Aug-2021 Jeremy Morse <jeremy.morse@sony.com>

[DebugInfo][InstrRef] Honour too-much-debug-info cutouts

This reapplies 54a61c94f93, its follow up in 547b712500e, which were
reverted 95fe61e63954. Original commit message:

VarLoc based LiveDebugV

[DebugInfo][InstrRef] Honour too-much-debug-info cutouts

This reapplies 54a61c94f93, its follow up in 547b712500e, which were
reverted 95fe61e63954. Original commit message:

VarLoc based LiveDebugValues will abandon variable location propagation if
there are too many blocks and variable assignments in the function. If it
didn't, and we had (say) 1000 blocks and 1000 variables in scope, we'd end
up with 1 million DBG_VALUEs just at the start of blocks.

Instruction-referencing LiveDebugValues should honour this limitation too
(because the same limitation applies to it). Hoist the relevant command
line options into LiveDebugValues.cpp and pass it down into the
implementation classes as an argument to ExtendRanges. I've duplicated all
the run-lines in live-debug-values-cutoffs.mir to have an
instruction-referencing flavour.

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

show more ...


# 95fe61e6 16-Aug-2021 Jeremy Morse <jeremy.morse@sony.com>

Revert 54a61c94f93 and its follow up in 547b712500e

These were part of D107823, however asan has found something excitingly
wrong happening:

https://lab.llvm.org/buildbot/#/builders/5/builds/10543

Revert 54a61c94f93 and its follow up in 547b712500e

These were part of D107823, however asan has found something excitingly
wrong happening:

https://lab.llvm.org/buildbot/#/builders/5/builds/10543/steps/13/logs/stdio

show more ...


# 547b7125 16-Aug-2021 Jeremy Morse <jeremy.morse@sony.com>

Suppress signedness-comparison warning

This is a follow-up to 54a61c94f93.


# 54a61c94 16-Aug-2021 Jeremy Morse <jeremy.morse@sony.com>

[DebugInfo][InstrRef] Honour too-much-debug-info cutouts

VarLoc based LiveDebugValues will abandon variable location propagation if
there are too many blocks and variable assignments in the function

[DebugInfo][InstrRef] Honour too-much-debug-info cutouts

VarLoc based LiveDebugValues will abandon variable location propagation if
there are too many blocks and variable assignments in the function. If it
didn't, and we had (say) 1000 blocks and 1000 variables in scope, we'd end
up with 1 million DBG_VALUEs just at the start of blocks.

Instruction-referencing LiveDebugValues should honour this limitation too
(because the same limitation applies to it). Hoist the relevant command
line options into LiveDebugValues.cpp and pass it down into the
implementation classes as an argument to ExtendRanges. I've duplicated all
the run-lines in live-debug-values-cutoffs.mir to have an
instruction-referencing flavour.

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

show more ...


Revision tags: llvmorg-13.0.0-rc1, llvmorg-14-init
# 30cce54d 09-Jul-2021 Jeremy Morse <jeremy.morse@sony.com>

[X86] Return src/dest register from stack spill/restore recogniser

LLVM provides target hooks to recognise stack spill and restore
instructions, such as isLoadFromStackSlot, and it also provides pos

[X86] Return src/dest register from stack spill/restore recogniser

LLVM provides target hooks to recognise stack spill and restore
instructions, such as isLoadFromStackSlot, and it also provides post frame
elimination versions such as isLoadFromStackSlotPostFE. These are supposed
to return the store-source and load-destination registers; unfortunately on
X86, the PostFE recognisers just return "1", apparently to signify "yes
it's a spill/load". This patch alters the hooks to correctly return the
store-source and load-destination registers:

This is really useful for debug-info as we it helps follow variable values
as they move on/off the stack. There should be no codegen changes: the only
other users of these PostFE target hooks are MachineInstr::getRestoreSize
and MachineInstr::getSpillSize, which don't attempt to interpret the
returned register location.

While we're here, delete the (InstrRef) LiveDebugValues heuristic that
tries to find the spill source register by looking for a killed reg -- we
should be able to rely on the target hooks for that. This involves
temporarily turning off a n InstrRef LivedDebugValues test on aarch64
(patch to re-enable it is in D104521).

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

show more ...


# f551fb96 09-Jul-2021 Jeremy Morse <jeremy.morse@sony.com>

[Debug-info][InstrRef] Avoid an unnecessary map ordering

We keep a record of substitutions between debug value numbers post-isel,
however we never actually look them up until the end of compilation.

[Debug-info][InstrRef] Avoid an unnecessary map ordering

We keep a record of substitutions between debug value numbers post-isel,
however we never actually look them up until the end of compilation. As a
result, there's nothing gained by the collection being a std::map. This
patch downgrades it to being a vector, that's then sorted at the end of
compilation in LiveDebugValues.

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

show more ...


# e9641c91 01-Jul-2021 Jeremy Morse <jeremy.morse@sony.com>

[DebugInfo][InstrRef][2/4] Use subreg substitutions in LiveDebugValues

Added in 47c3fe2a22cf, we sometimes need to describe a variable value
substitution with a subregister qualifier, to say that "t

[DebugInfo][InstrRef][2/4] Use subreg substitutions in LiveDebugValues

Added in 47c3fe2a22cf, we sometimes need to describe a variable value
substitution with a subregister qualifier, to say that "the value is the
lower 32 bits of this 64 bit register def" for example. That then needs
support during LiveDebugValues to interpret the subregister qualifiers,
which is what this patch adds.

Whenever we encounter a DBG_INSTR_REF and find its value by using a
substitution, collect any subregister qualifiers seen. Then, accumulate the
effects of the qualifiers to work out what offset and what size should be
extracted from the defined register. Finally, for the target ValueIDNum,
extract whatever subregister is in the correct position

Currently, describing a subregister field of a larger value that has been
spilt to the stack, is unimplemented.

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

show more ...


# 47c3fe2a 01-Jul-2021 Jeremy Morse <jeremy.morse@sony.com>

[DebugInfo][InstrRef][1/4] Support transformations that widen values

Very late in compilation, backends like X86 will perform optimisations like
this:

$cx = MOV16rm $rax, ...
->
$rcx =

[DebugInfo][InstrRef][1/4] Support transformations that widen values

Very late in compilation, backends like X86 will perform optimisations like
this:

$cx = MOV16rm $rax, ...
->
$rcx = MOV64rm $rax, ...

Widening the load from 16 bits to 64 bits. SEeing how the lower 16 bits
remain the same, this doesn't affect execution. However, any debug
instruction reference to the defined operand now refers to a 64 bit value,
nto a 16 bit one, which might be unexpected. Elsewhere in codegen, there's
often this pattern:

CALL64pcrel32 @foo, implicit-def $rax
%0:gr64 = COPY $rax
%1:gr32 = COPY %0.sub_32bit

Where we want to refer to the definition of $eax by the call, but don't
want to refer the copies (they don't define values in the way
LiveDebugValues sees it). To solve this, add a subregister field to the
existing "substitutions" facility, so that we can describe a field within
a larger value definition. I would imagine that this would be used most
often when a value is widened, and we need to refer to the original,
narrower definition.

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

show more ...


# 1575583f 30-Jun-2021 Jeremy Morse <jeremy.morse@sony.com>

[LiveDebugValues][InstrRef][2/2] Emit entry value variable locations

This patch adds support to the instruction-referencing LiveDebugValues
implementation for emitting entry values. The instruction

[LiveDebugValues][InstrRef][2/2] Emit entry value variable locations

This patch adds support to the instruction-referencing LiveDebugValues
implementation for emitting entry values. The instruction referencing
implementations tracking by value rather than location means that we can
get around two of the issues with VarLocs. DBG_VALUE instructions that
re-assign the same value to a variable are no longer a problem, because we
can "see through" to the value being assigned. We also don't need to do
anything special during the dataflow stages: the "variable value problem"
doesn't need to know whether a value is available most of the time, and the
times it deoes need to know are always when entry values need to be
terminated.

The patch modifies the "TransferTracker" class, adding methods to identify
when a variable ias an entry value candidate, and when a machine value is
an entry value. recoverAsEntryValue tests these two things and emits an
entry-value expression if they're true. It's used when we clobber or
otherwise lose a value and can't find a replacement location for the value
it contained.

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

show more ...


# 49555441 29-Jun-2021 Jeremy Morse <jeremy.morse@sony.com>

[LiveDebugValues][InstrRef][1/2] Recover more clobbered variable locations

In various circumstances, when we clobber a register there may be
alternative locations that the value is live in. The clas

[LiveDebugValues][InstrRef][1/2] Recover more clobbered variable locations

In various circumstances, when we clobber a register there may be
alternative locations that the value is live in. The classic example would
be a value loaded from the stack, and then clobbered: the value is still
available on the stack. InstrRefBasedLDV was coping with this at block
starts where it's forced to pick a location, however it wasn't searching
for alternative locations when values were clobbered.

This patch notifies the "Transfer Tracker" object when clobbers occur, and
it's able to find alternatives and issue DBG_VALUEs for that location. See:
the added test.

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

show more ...


# 632e15e7 29-Jun-2021 David Blaikie <dblaikie@gmail.com>

Conditionalize function only used in an assert to address -Wunused-function


# e63b18bc 29-Jun-2021 Jeremy Morse <jeremy.morse@sony.com>

Catch an extremely obvious memory leak, thanks asan

https://lab.llvm.org/buildbot/#/builders/5/builds/9208

(dbg-phis-merging-in-ldv.mir and dbg-phis-with-loops.mir in the asan
check stage)


# 010108bb 29-Jun-2021 Jeremy Morse <jeremy.morse@sony.com>

[DebugInstrRef][3/3] Follow DBG_PHI instructions through LiveDebugValues

This patch reads machine value numbers from DBG_PHI instructions (marking
where SSA PHIs used to be), and matches them up wit

[DebugInstrRef][3/3] Follow DBG_PHI instructions through LiveDebugValues

This patch reads machine value numbers from DBG_PHI instructions (marking
where SSA PHIs used to be), and matches them up with DBG_INSTR_REF
instructions that refer to them. Essentially they are two separate parts of
a DBG_VALUE: the place to read the value (register and program position),
and where the variable is assigned that value.

Sometimes these DBG_PHIs can be duplicated, usually by tail duplication.
This corresponds to the SSA structure of the program being destroyed, and
the original PHI being split. When this happens: run LLVMs standard
SSAUpdater utility, to work out what values should appear in which blocks.
The majority of this patch is boilerplate to make use of SSAUpdater.

If there are any additional PHIs on the path between multiple DBG_PHIs and
their using DBG_INSTR_REF, their existance is validated, just in case a
value gets clobbered along the way (see dbg-phis-with-loops.mir for
several examples).

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

show more ...


Revision tags: llvmorg-12.0.1, llvmorg-12.0.1-rc4, llvmorg-12.0.1-rc3
# 59d90fe8 19-Jun-2021 Fangrui Song <i@maskray.me>

Simplify some typedef struct


Revision tags: llvmorg-12.0.1-rc2, llvmorg-12.0.1-rc1
# 7e5682ee 28-Apr-2021 Benjamin Kramer <benny.kra@googlemail.com>

[ADT] Make TrackingStatistic's ctor constexpr

This lets clang diagnose unused statistics, so remove them.


Revision tags: llvmorg-12.0.0, llvmorg-12.0.0-rc5, llvmorg-12.0.0-rc4, llvmorg-12.0.0-rc3, llvmorg-12.0.0-rc2
# d5adba10 14-Feb-2021 Kazu Hirata <kazu@google.com>

[CodeGen] Use range-based for loops (NFC)


Revision tags: llvmorg-11.1.0, llvmorg-11.1.0-rc3
# 7925aa09 29-Jan-2021 Kazu Hirata <kazu@google.com>

[llvm] Populate SmallVector at construction time (NFC)


Revision tags: llvmorg-12.0.0-rc1, llvmorg-13-init, llvmorg-11.1.0-rc2
# 9bcc0d10 15-Jan-2021 Kazu Hirata <kazu@google.com>

[CodeGen, Transforms] Use llvm::sort (NFC)


Revision tags: llvmorg-11.1.0-rc1
# 84a11209 06-Jan-2021 Sander de Smalen <sander.desmalen@arm.com>

[LiveDebugValues] Handle spill locations with a fixed and scalable component.

This patch fixes the two LiveDebugValues implementations
(InstrRef/VarLoc)Based to handle cases where the StackOffset co

[LiveDebugValues] Handle spill locations with a fixed and scalable component.

This patch fixes the two LiveDebugValues implementations
(InstrRef/VarLoc)Based to handle cases where the StackOffset contains
both a fixed and scalable component.

This depends on the `TargetRegisterInfo::prependOffsetExpression` being
added in D90020. Feel free to leave comments on that patch if you have them.

Reviewed By: djtodoro, jmorse

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

show more ...


# 805d5959 19-Dec-2020 Kazu Hirata <kazu@google.com>

[Analysis, CodeGen, IR] Use contains (NFC)


Revision tags: llvmorg-11.0.1, llvmorg-11.0.1-rc2
# b5ad32ef 11-Dec-2020 Fangrui Song <i@maskray.me>

Migrate deprecated DebugLoc::get to DILocation::get

This migrates all LLVM (except Kaleidoscope and
CodeGen/StackProtector.cpp) DebugLoc::get to DILocation::get.

The CodeGen/StackProtector.cpp usag

Migrate deprecated DebugLoc::get to DILocation::get

This migrates all LLVM (except Kaleidoscope and
CodeGen/StackProtector.cpp) DebugLoc::get to DILocation::get.

The CodeGen/StackProtector.cpp usage may have a nullptr Scope
and can trigger an assertion failure, so I don't migrate it.

Reviewed By: #debug-info, dblaikie

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

show more ...


Revision tags: llvmorg-11.0.1-rc1
# 22fd38d5 05-Nov-2020 Djordje Todorovic <djtodoro@cisco.com>

[NFC][IntrRefLDV] Remove dead code from transferSpillOrRestoreInst()

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


# d57bba7c 04-Nov-2020 Sander de Smalen <sander.desmalen@arm.com>

[SVE] Return StackOffset for TargetFrameLowering::getFrameIndexReference.

To accommodate frame layouts that have both fixed and scalable objects
on the stack, describing a stack location or offset u

[SVE] Return StackOffset for TargetFrameLowering::getFrameIndexReference.

To accommodate frame layouts that have both fixed and scalable objects
on the stack, describing a stack location or offset using a pointer + uint64_t
is not sufficient. For this reason, we've introduced the StackOffset class,
which models both the fixed- and scalable sized offsets.

The TargetFrameLowering::getFrameIndexReference is made to return a StackOffset,
so that this can be used in other interfaces, such as to eliminate frame indices
in PEI or to emit Debug locations for variables on the stack.

This patch is purely mechanical and doesn't change the behaviour of how
the result of this function is used for fixed-sized offsets. The patch adds
various checks to assert that the offset has no scalable component, as frame
offsets with a scalable component are not yet supported in various places.

Reviewed By: arsenm

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

show more ...


# 63843785 28-Oct-2020 Djordje Todorovic <djordje.todorovic@syrmia.com>

[NFC][IntrRefLDV] Improve the Value printing

Basically, this just improves the dump of the Value stored within a location.

If the defining instruction number is zero, it means it is "live-in".

Bef

[NFC][IntrRefLDV] Improve the Value printing

Basically, this just improves the dump of the Value stored within a location.

If the defining instruction number is zero, it means it is "live-in".

Before the patch:

ESI --> bb 0 inst 0 loc ESI
After:

ESI --> Value{bb: 0, inst: live-in, loc: ESI}
This is an NFC.

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

show more ...


# cca049ad 26-Oct-2020 Djordje Todorovic <djordje.todorovic@syrmia.com>

[NFC][IntrRefLDV] Some code clean up

As reading the source code, I've found some minor nits:
-Use using instead of typedef
-Fix a comment
-Refactor

Differential Revision: https://reviews.llvm

[NFC][IntrRefLDV] Some code clean up

As reading the source code, I've found some minor nits:
-Use using instead of typedef
-Fix a comment
-Refactor

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

show more ...


1234567