History log of /llvm-project/llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.cpp (Results 1 – 25 of 161)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
Revision tags: llvmorg-21-init
# cb714e74 23-Jan-2025 Jeremy Morse <jeremy.morse@sony.com>

[DebugInfo][InstrRef] Avoid producing broken DW_OP_deref_sizes (#123967)

We use variable locations such as DBG_VALUE $xmm0 as shorthand to refer
to "the low lane of $xmm0", and this is reflected in

[DebugInfo][InstrRef] Avoid producing broken DW_OP_deref_sizes (#123967)

We use variable locations such as DBG_VALUE $xmm0 as shorthand to refer
to "the low lane of $xmm0", and this is reflected in how DWARF is
interpreted too. However InstrRefBasedLDV tries to be smart and
interprets such a DBG_VALUE as a 128-bit reference. We then issue a
DW_OP_deref_size of 128 bits to the stack, which isn't permitted by
DWARF (it's larger than a pointer).

Solve this for now by not using DW_OP_deref_size if it would be illegal.
Instead we'll use DW_OP_deref, and the consumer will load the variable
type from the stack, which should be correct.

There's still a risk of imprecision when LLVM decides to use smaller or
larger value types than the source-variable type, which manifests as
too-little or too-much memory being read from the stack. However we
can't solve that without putting more type information in debug-info.

fixes #64093

show more ...


# b7eee2c3 19-Jan-2025 Craig Topper <craig.topper@sifive.com>

[CodeGen] Remove some implict conversions of MCRegister to unsigned by using(). NFC

Many of these are indexing BitVectors or something where we can't
using MCRegister and need the register number.


Revision tags: llvmorg-19.1.7, llvmorg-19.1.6
# 1562b70e 13-Dec-2024 paperchalice <liujunchang97@outlook.com>

Reapply "[DomTreeUpdater] Move critical edge splitting code to updater" (#119547)

This relands commit #115111.
Use traditional way to update post dominator tree, i.e. break critical
edge splitting

Reapply "[DomTreeUpdater] Move critical edge splitting code to updater" (#119547)

This relands commit #115111.
Use traditional way to update post dominator tree, i.e. break critical
edge splitting into insert, insert, delete sequence.
When splitting critical edges, the post dominator tree may change its
root node, and `setNewRoot` only works in normal dominator tree...
See

https://github.com/llvm/llvm-project/blob/6c7e5827eda26990e872eb7c3f0d7866ee3c3171/llvm/include/llvm/Support/GenericDomTree.h#L684-L687

show more ...


# 553058f8 11-Dec-2024 paperchalice <liujunchang97@outlook.com>

Revert "[DomTreeUpdater] Move critical edge splitting code to updater" (#119512)

Reverts llvm/llvm-project#115111 Causes #119511


# 79047fac 11-Dec-2024 paperchalice <liujunchang97@outlook.com>

[DomTreeUpdater] Move critical edge splitting code to updater (#115111)

Support critical edge splitting in dominator tree updater. Continue the
work in #100856.

Compile time check:
https://llvm

[DomTreeUpdater] Move critical edge splitting code to updater (#115111)

Support critical edge splitting in dominator tree updater. Continue the
work in #100856.

Compile time check:
https://llvm-compile-time-tracker.com/compare.php?from=87c35d782795b54911b3e3a91a5b738d4d870e55&to=42b3e5623a9ab4c3648564dc0926b36f3b438a3a&stat=instructions%3Au

show more ...


Revision tags: llvmorg-19.1.5
# 46f43b6d 21-Nov-2024 abhishek-kaushik22 <abhishek.kaushik@intel.com>

[DebugInfo][InstrRef][MIR][GlobalIsel][MachineLICM] NFC Use std::move to avoid copying (#116935)


Revision tags: llvmorg-19.1.4, llvmorg-19.1.3, llvmorg-19.1.2, llvmorg-19.1.1
# d3ca4844 28-Sep-2024 Kazu Hirata <kazu@google.com>

[LiveDebugValues] Avoid repeated hash lookups (NFC) (#110379)


Revision tags: llvmorg-19.1.0
# 3a274584 13-Sep-2024 Kazu Hirata <kazu@google.com>

[LiveDebugValues] Avoid repeated hash lookups (NFC) (#108484)


Revision tags: llvmorg-19.1.0-rc4, llvmorg-19.1.0-rc3, llvmorg-19.1.0-rc2
# 8d1b17b6 04-Aug-2024 Kazu Hirata <kazu@google.com>

[CodeGen] Construct SmallVector with ArrayRef (NFC) (#101841)


# 34d48279 29-Jul-2024 Kazu Hirata <kazu@google.com>

[llvm] Initialize SmallVector with ranges (NFC) (#100948)


Revision tags: llvmorg-19.1.0-rc1, llvmorg-20-init
# 574dbe3e 18-Jul-2024 Christopher Di Bella <cjdb@google.com>

suppresses unused variable warning (#99526)


# 676efd0f 18-Jul-2024 Jeremy Morse <jeremy.morse@sony.com>

Reapply 078198f310d5 "Index DebugVariables and some DILocations"

Now revised to actually make the unit test compile, which I'd been
ignoring. No actual functional change, it's a type difference.
Ori

Reapply 078198f310d5 "Index DebugVariables and some DILocations"

Now revised to actually make the unit test compile, which I'd been
ignoring. No actual functional change, it's a type difference.
Original commit message follows.

[DebugInfo][InstrRef] Index DebugVariables and some DILocations (#99318)

A lot of time in LiveDebugValues is spent computing DenseMap keys for
DebugVariables, and they're made up of three pointers, so are large.
This patch installs an index for them: for the SSA and value-to-location
mapping parts of InstrRefBasedLDV we don't need to access things like
the variable declaration or the inlining site, so just use a uint32_t
identifier for each variable fragment that's tracked. The compile-time
performance improvements are substantial (almost 0.4% on the tracker).

About 80% of this patch is just replacing DebugVariable references with
DebugVariableIDs instead, however there are some larger consequences. We
spend lots of time fetching DILocations when emitting DBG_VALUE
instructions, so index those with the DebugVariables: this means all
DILocations on all new DBG_VALUE instructions will normalise to the
first-seen DILocation for the variable (which should be fine).

We also used to keep an ordering of when each variable was seen first in
a DBG_* instruction, in the AllVarsNumbering collection, so that we can
emit new DBG_* instructions in a stable order. We can hang this off the
DebugVariable index instead, so AllVarsNumbering is deleted.

Finally, rather than ordering by AllVarsNumbering just before DBG_*
instructions are linked into the output MIR, store instructions along
with their DebugVariableID, so that they can be sorted by that instead.

show more ...


# 50b657c8 18-Jul-2024 Jeremy Morse <jeremy.morse@sony.com>

Revert "[DebugInfo][InstrRef] Index DebugVariables and some DILocations (#99318)"

This reverts commit 078198f310d55925ccd9e1aa5b6ff4af3b36bbc7.

Buildbots unhappy, I must have fluffed it


# 078198f3 18-Jul-2024 Jeremy Morse <jeremy.morse@sony.com>

[DebugInfo][InstrRef] Index DebugVariables and some DILocations (#99318)

A lot of time in LiveDebugValues is spent computing DenseMap keys for
DebugVariables, and they're made up of three pointers,

[DebugInfo][InstrRef] Index DebugVariables and some DILocations (#99318)

A lot of time in LiveDebugValues is spent computing DenseMap keys for
DebugVariables, and they're made up of three pointers, so are large.
This patch installs an index for them: for the SSA and value-to-location
mapping parts of InstrRefBasedLDV we don't need to access things like
the variable declaration or the inlining site, so just use a uint32_t
identifier for each variable fragment that's tracked. The compile-time
performance improvements are substantial (almost 0.4% on the tracker).

About 80% of this patch is just replacing DebugVariable references with
DebugVariableIDs instead, however there are some larger consequences. We
spend lots of time fetching DILocations when emitting DBG_VALUE
instructions, so index those with the DebugVariables: this means all
DILocations on all new DBG_VALUE instructions will normalise to the
first-seen DILocation for the variable (which should be fine).

We also used to keep an ordering of when each variable was seen first in
a DBG_* instruction, in the AllVarsNumbering collection, so that we can
emit new DBG_* instructions in a stable order. We can hang this off the
DebugVariable index instead, so AllVarsNumbering is deleted.

Finally, rather than ordering by AllVarsNumbering just before DBG_*
instructions are linked into the output MIR, store instructions along
with their DebugVariableID, so that they can be sorted by that instead.

show more ...


# e093109e 17-Jul-2024 Jeremy Morse <jeremy.morse@sony.com>

[InstrRef][NFC] Avoid another DenseMap, use a sorted vector (#99051)

When resolving value-numbers to specific machine locations in the final
stages of LiveDebugValues, we've been producing a DenseM

[InstrRef][NFC] Avoid another DenseMap, use a sorted vector (#99051)

When resolving value-numbers to specific machine locations in the final
stages of LiveDebugValues, we've been producing a DenseMap containing
all the value-numbers we're interested in. However we never modify the
map keys as they're all pre-known. Thus, this is a suitable collection
to switch to a sorted vector that gets searched, rather than a DenseMap
that gets probed. The overall operation of LiveDebugValues isn't
affected at all.

show more ...


# 0b71d802 17-Jul-2024 Jeremy Morse <jeremy.morse@sony.com>

[InstrRef][NFC] Avoid un-necessary DenseMap queries (#99048)

This patch adjusts how some data is stored to avoid a number of
un-necessary DenseMap queries. There's no change to the compiler
behavi

[InstrRef][NFC] Avoid un-necessary DenseMap queries (#99048)

This patch adjusts how some data is stored to avoid a number of
un-necessary DenseMap queries. There's no change to the compiler
behaviour, and it's measurably faster on the compile time tracker.

The BlockOrders vector in buildVLocValueMap collects the blocks over
which a variables value have to be determined: however the Cmp ordering
function makes two DenseMap queries to determine the RPO-order of blocks
being compared. And given that sorting is O(N log(N)) comparisons this
isn't fast. So instead, fetch the RPO-numbers of the block collection,
order those, and then map back to the blocks themselves.

The OrderToBB collection mapped an RPO-number to an MBB: it's completely
un-necessary to have DenseMap here, we can just use the RPO number as an
array index. Switch it to a SmallVector and deal with a few consequences
when iterating.

(And for good measure I've jammed in a couple of reserve calls).

show more ...


# 6a907699 11-Jul-2024 Nikita Popov <npopov@redhat.com>

Revert "[CodeGen] Remove `applySplitCriticalEdges` in `MachineDominatorTree` (#97055)"

This reverts commit c5e5088033fed170068d818c54af6862e449b545.

Causes large compile-time regressions.


# c5e50880 11-Jul-2024 paperchalice <liujunchang97@outlook.com>

[CodeGen] Remove `applySplitCriticalEdges` in `MachineDominatorTree` (#97055)

Summary:
- Remove wrappers in `MachineDominatorTree`.
- Remove `MachineDominatorTree` update code in
`MachineBasicBlo

[CodeGen] Remove `applySplitCriticalEdges` in `MachineDominatorTree` (#97055)

Summary:
- Remove wrappers in `MachineDominatorTree`.
- Remove `MachineDominatorTree` update code in
`MachineBasicBlock::SplitCriticalEdge`.
- Use `MachineDomTreeUpdater` in passes which call
`MachineBasicBlock::SplitCriticalEdge` and preserve
`MachineDominatorTreeWrapperPass` or CFG analyses.

Commit abea99f65a97248974c02a5544eaf25fc4240056 introduced related
methods in 2014. Now we have SemiNCA based dominator tree in 2017 and
dominator tree updater, the solution adopted here seems a bit outdated.

show more ...


# 0e6257fb 30-Jun-2024 Nuno Lopes <nuno.lopes@tecnico.ulisboa.pt>

SSAUpdater: use poison instead of undef in phi entries for unreachable predecessors


Revision tags: llvmorg-18.1.8, llvmorg-18.1.7, llvmorg-18.1.6, llvmorg-18.1.5, llvmorg-18.1.4, llvmorg-18.1.3, llvmorg-18.1.2
# 601e102b 17-Mar-2024 David Green <david.green@arm.com>

[CodeGen] Use LocationSize for MMO getSize (#84751)

This is part of #70452 that changes the type used for the external
interface of MMO to LocationSize as opposed to uint64_t. This means the
const

[CodeGen] Use LocationSize for MMO getSize (#84751)

This is part of #70452 that changes the type used for the external
interface of MMO to LocationSize as opposed to uint64_t. This means the
constructors take LocationSize, and convert ~UINT64_C(0) to
LocationSize::beforeOrAfter(). The getSize methods return a
LocationSize.

This allows us to be more precise with unknown sizes, not accidentally
treating them as unsigned values, and in the future should allow us to
add proper scalable vector support but none of that is included in this
patch. It should mostly be an NFC.

Global ISel is still expected to use the underlying LLT as it needs, and
are not expected to see unknown sizes for generic operations. Most of
the changes are hopefully fairly mechanical, adding a lot of getValue()
calls and protecting them with hasValue() where needed.

show more ...


Revision tags: llvmorg-18.1.1, llvmorg-18.1.0, llvmorg-18.1.0-rc4, llvmorg-18.1.0-rc3, llvmorg-18.1.0-rc2, llvmorg-18.1.0-rc1, llvmorg-19-init
# 52613396 11-Jan-2024 HaohaiWen <haohai.wen@intel.com>

[InstrRef] Add debug hint for not reachable blocks from entry (#77725)

Those not reachable blocks was not analyzed by LiveDebugValues and may
raise out of bound access to VarLocs as case in #77441.


# acacec3b 23-Dec-2023 Felipe de Azevedo Piovezan <fpiovezan@apple.com>

[LiveDebugValues][nfc] Reduce memory usage of InstrRef (#76051)

Commit 1b531d54f623 (#74203) removed the usage of unique_ptrs of arrays
in favour of using vectors, but inadvertently increased peak

[LiveDebugValues][nfc] Reduce memory usage of InstrRef (#76051)

Commit 1b531d54f623 (#74203) removed the usage of unique_ptrs of arrays
in favour of using vectors, but inadvertently increased peak memory
usage by removing the ability to deallocate vector memory that was no
longer needed mid-LDV.

In that same review, it was pointed out that `FuncValueTable` typedef
could be removed, since it was "just a vector".

This commit addresses both issues by making `FuncValueTable` a real data
structure, capable of mapping BBs to ValueTables and able to free
ValueTables as needed.

This reduces peak memory usage in the compiler by 10% in the benchmarks
flagged by the original review.

As a consequence, we had to remove a handful of instances of the
"declare-then-initialize" antipattern in unittests, as the
FuncValueTable class is no longer default-constructible.

show more ...


# da2db4a9 18-Dec-2023 Felipe de Azevedo Piovezan <fpiovezan@apple.com>

[InstrRef][NFC] Delete unused variables (#75501)

`V` was unused, and all the other deletions follow from that
observation.


# 1b531d54 14-Dec-2023 Felipe de Azevedo Piovezan <fpiovezan@apple.com>

[InstrRef][nfc] Remove usage of unique_ptrs of arrays (#74203)

These are usually difficult to reason about, and they were being used to
pass raw pointers around with array semantic (i.e., we were u

[InstrRef][nfc] Remove usage of unique_ptrs of arrays (#74203)

These are usually difficult to reason about, and they were being used to
pass raw pointers around with array semantic (i.e., we were using
operator [] on raw pointers). To put it in InstrRef terminology: we were
passing a pointer to a ValueTable but using it as if it were a
FuncValueTable.

These could have easily been SmallVectors, which now allow us to have
reference semantics in some places, as well as simpler initialization.

In the future, we can use even more pass-by-reference with some extra
changes in the code.

show more ...


# 7649d223 14-Dec-2023 DianQK <dianqk@dianqk.net>

[AArch64] ORRWrs is copy instruction when there's no implicit def of the X register (#75184)

Follows
https://github.com/llvm/llvm-project/pull/74682#issuecomment-1850268782.
Fixes #74680.


1234567