History log of /llvm-project/llvm/lib/CodeGen/AssignmentTrackingAnalysis.cpp (Results 26 – 50 of 56)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
Revision tags: llvmorg-17.0.6
# 03f05a4e 21-Nov-2023 Nikita Popov <npopov@redhat.com>

[IR] Don't include GenericDomTreeConstruction.h in header (NFC)

The whole point of the GenericDomTree.h vs
GenericDomTreeConstruction.h distinction is that the latter only
needs to be included in th

[IR] Don't include GenericDomTreeConstruction.h in header (NFC)

The whole point of the GenericDomTree.h vs
GenericDomTreeConstruction.h distinction is that the latter only
needs to be included in the source file and not the header.

show more ...


Revision tags: llvmorg-17.0.5
# 01702c3f 11-Nov-2023 Kazu Hirata <kazu@google.com>

[llvm] Stop including llvm/ADT/SmallSet.h (NFC)

Identified with clangd.


Revision tags: llvmorg-17.0.4, llvmorg-17.0.3, llvmorg-17.0.2, llvmorg-17.0.1, llvmorg-17.0.0
# 7afc7db7 15-Sep-2023 Orlando Cazalet-Hyams <orlando.hyams@sony.com>

[Assignment Tracking] Trim assignments for untagged out of bounds stores (#66095)

Fixes #65004 by trimming assignments from out of bounds stores (out of bounds
of either the base variable or the ba

[Assignment Tracking] Trim assignments for untagged out of bounds stores (#66095)

Fixes #65004 by trimming assignments from out of bounds stores (out of bounds
of either the base variable or the backing alloca). If there's no overlap at
all or the out of bounds access starts at a negative offset from the alloca,
the assignment is simply skipped.

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
# ac6e177c 26-Apr-2023 OCHyams <orlando.hyams@sony.com>

[Assignment Tracking] Remove overly defensive AllocaInst assertion

Remove assert from AssignmentTrackingAnalysis that fires if a local variable
has non-alloca storage. The analysis can emit these lo

[Assignment Tracking] Remove overly defensive AllocaInst assertion

Remove assert from AssignmentTrackingAnalysis that fires if a local variable
has non-alloca storage. The analysis can emit these locations but the
assignment tracking code in SelectionDAG isn't ready to handle non-alloca
storage for locals yet. The AssignmentTrackingPass (pass that adds assignment
tracking metadata) ignores non-alloca dbg.declares, so the only variables
affected are those who's backing storage is changed from an alloca during
optimisation, and the result is the variables are dropped.

Fixes: https://ci.chromium.org/ui/p/pigweed/builders/toolchain/
toolchain-ci-pigweed-linux/b8783274592206481489/overview

Reviewed By: StephenTozer

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

show more ...


# b59d672e 26-Apr-2023 OCHyams <orlando.hyams@sony.com>

[Assignment Tracking] Fix faulty assertion inside std::sort predicate

The vectors being sorted here shouldn't contain duplicate entries. Prior to
this patch this was checked with an assert within th

[Assignment Tracking] Fix faulty assertion inside std::sort predicate

The vectors being sorted here shouldn't contain duplicate entries. Prior to
this patch this was checked with an assert within the `std::sort`
predicate. However, `std::sort` may compare an element against itself which
causes the assert to fire (false positive). Move the assert outside of the sort
predicate to avoid such issues.

Reviewed By: StephenTozer

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

show more ...


Revision tags: llvmorg-16.0.2
# 93c194fc 05-Apr-2023 OCHyams <orlando.hyams@sony.com>

[Assignment Tracking] Ignore zero-sized fragments

Such dbg.assigns will occur if you write zero-sized memcpys (see
https://reviews.llvm.org/D146987#4240016).

Handle this in AssignmentTrackingAnalys

[Assignment Tracking] Ignore zero-sized fragments

Such dbg.assigns will occur if you write zero-sized memcpys (see
https://reviews.llvm.org/D146987#4240016).

Handle this in AssignmentTrackingAnalysis (back end) rather than
AssignmentTrackingPass (declare-to-assign) in case it is possible to reproduce
this as a result of optimisations.

Reviewed By: jmorse

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

show more ...


Revision tags: llvmorg-16.0.1
# 66268c8e 31-Mar-2023 Wang, Xin10 <xin10.wang@intel.com>

[NFC]add & to avoid copy

The elements in FragmentMap are big objects, use reference can get
better performance, as someone do in line 1912.

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


# d4879d76 29-Mar-2023 OCHyams <orlando.hyams@sony.com>

[Assignment Tracking] Coalesce dbg loc definitions with contiguous fragments

MemLocFragmentFill uses an IntervalMap to track which bits of each variable are
stack-homed. Intervals with the same valu

[Assignment Tracking] Coalesce dbg loc definitions with contiguous fragments

MemLocFragmentFill uses an IntervalMap to track which bits of each variable are
stack-homed. Intervals with the same value (same stack location base address)
are automatically coalesced by the map. This patch changes the analysis to take
advantage of that and insert a new dbg loc after each def if any coalescing
took place. This results in some additional redundant defs (we insert a def,
then another that by definition shadows the previous one if any coalescing took
place) but they're all cleaned up thanks to the previous patch in this stack.

This reduces the total number of fragments created by
AssignmentTrackingAnalysis which reduces compile time because LiveDebugValues
computes SSA for every fragment it encounters. There's a geomean reduction in
instructions retired in a CTMark LTO-O3-g build of 0.3% with these two patches.

One small caveat is that this technique can produce partially overlapping
fragments (e.g. slice [0, 32) and slice [16, 64)), which we know
LiveDebugVariables doesn't really handle correctly. Used in combination with
instruction-referencing this isn't a problem, since LiveDebugVariables is
effectively side-stepped in instruction-referencing mode. Given this, the
coalescing is only enabled when instruction-referencing is enabled (but the
behaviour can be overriden using -debug-ata-coalesce-frags=<bool>).

Reviewed By: jmorse

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

show more ...


# 8e56a196 29-Mar-2023 OCHyams <orlando.hyams@sony.com>

[Assignment Tracking] Improve removeRedundantDbgLocsUsingBackwardScan

`removeRedundantDbgLocsUsingBackwardScan` removes redundant dbg loc definitions
by scanning backwards through contiguous sets of

[Assignment Tracking] Improve removeRedundantDbgLocsUsingBackwardScan

`removeRedundantDbgLocsUsingBackwardScan` removes redundant dbg loc definitions
by scanning backwards through contiguous sets of them (a "wedge"), removing
earlier (in IR order terms) defs for fragments of variables that are defined
later in the wedge.

In this patch we use a `Bitvector` for each variable to track which bits have
definitions to more accurately determine whether a loc def is redundant. This
patch increases compile time by itself, but reduces it when combined with the
follow-up patch.

Reviewed By: jmorse

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

show more ...


# c4861e32 29-Mar-2023 OCHyams <orlando.hyams@sony.com>

[Assignment Tracking] Elide a map copy in some cases

Restructure AssignmentTrackingLowering::join to avoid a map copy in the case
where BB has more than one pred.

We only need to perform a copy of

[Assignment Tracking] Elide a map copy in some cases

Restructure AssignmentTrackingLowering::join to avoid a map copy in the case
where BB has more than one pred.

We only need to perform a copy of a pred LiveOut if there's exactly one
already-visited pred (Result = PredLiveOut). With more than one pred the result
is built by calling Result = join(std::move(Result), PredLiveOut) for each
subsequent pred, where join parameters are const &. i.e. with more than 1 pred
we can avoid copying by referencing the first two pred LiveOuts in the first
join and then using a move + reference for the rest.

This reduces compile time for CTMark LTO-O3-g builds.

Reviewed By: jmorse

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

show more ...


# cbfeec66 29-Mar-2023 OCHyams <orlando.hyams@sony.com>

[Assignment Tracking][NFC] Reduce work done in fragment overlap calculation

Only calculate fragment overlaps for partially stack homed variables. This
filter is already applied to the rest of the an

[Assignment Tracking][NFC] Reduce work done in fragment overlap calculation

Only calculate fragment overlaps for partially stack homed variables. This
filter is already applied to the rest of the analysis - this change simply
prevents some unnecessary work.

Reviewed By: jmorse

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

show more ...


# 0c36ab19 24-Mar-2023 Akshay Khadse <akshayskhadse@gmail.com>

[NFC] Fix auto usage to avoid copies

Fixes some usages of the "auto" keyword to avoid creation of copies.

Reviewed By: LuoYuanke

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


# d5b2c8e5 21-Mar-2023 OCHyams <orlando.hyams@sony.com>

[Assignment Tracking][NFC] Use BitVectors as masks for SmallVectors

...rather than using DenseMaps to track per-variable information.

Rather than tracking 3 maps of {VariableID: SomeInfo} per block

[Assignment Tracking][NFC] Use BitVectors as masks for SmallVectors

...rather than using DenseMaps to track per-variable information.

Rather than tracking 3 maps of {VariableID: SomeInfo} per block, use a
BitVector indexed by VariableID to mask 3 vectors of SomeInfo.

BlockInfos now need to be initialised with a call to init which sets the
BitVector width to the number of partially promoted variables in the function
and fills the vectors with Top values.

Prior to this patch, in joinBlockInfo, it was necessary to insert Top values
into the Join result for variables in A XOR B after joining the variables in A
AND B. Now, because the vectors are pre-filled with Top values we need only
join the variables A AND B and set the BitVector of tracked variables to A OR
B.

The patch achieves an average of 0.25% reduction in instructions retired and a
1.1% max-rss for the CTMark suite in LTO-O3-g builds.

Reviewed By: scott.linder

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

show more ...


Revision tags: llvmorg-16.0.0
# 47b99b7f 16-Mar-2023 OCHyams <orlando.hyams@sony.com>

[Assignment Tracking] Do not convert variadic locations to kill locations [3/x]

Reviewed By: StephenTozer

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


# 7d894374 16-Mar-2023 OCHyams <orlando.hyams@sony.com>

[Assignment Tracking][NFC] Use RawLocationWrapper in VarLocInfo [2/x]

Use RawLocationWrapper rather than a Value to represent the location operand(s)
so that it's possible to represent multiple loca

[Assignment Tracking][NFC] Use RawLocationWrapper in VarLocInfo [2/x]

Use RawLocationWrapper rather than a Value to represent the location operand(s)
so that it's possible to represent multiple location
operands. AssignmentTrackingAnalysis still converts variadic debug intrinsics
to kill locations so this patch is NFC.

Reviewed By: StephenTozer

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

show more ...


Revision tags: llvmorg-16.0.0-rc4
# 22b8e82c 25-Feb-2023 J. Ryan Stinnett <jryans@gmail.com>

[DebugInfo] Remove `dbg.addr` from CodeGen

As part of this work, removing `SDDbgValue::clearIsEmitted` originally added for
`dbg.addr` in 045c67769d7fe577fc38cccb6fb40fd814437447 was attempted, but

[DebugInfo] Remove `dbg.addr` from CodeGen

As part of this work, removing `SDDbgValue::clearIsEmitted` originally added for
`dbg.addr` in 045c67769d7fe577fc38cccb6fb40fd814437447 was attempted, but it
appears some tests for `DBG_INSTR_REF` now depend on that behaviour as well, so
it was kept and comments were updated instead.

Part of `dbg.addr` removal
Discussed in https://discourse.llvm.org/t/what-is-the-status-of-dbg-addr/62898

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

show more ...


# 258c806b 23-Feb-2023 OCHyams <orlando.hyams@sony.com>

[Assignment Tracking][NFC] Avoid doing some work when maps have same keys

Where the new checks have been added, `SymmetricDifference` - still being built
- contains entries for variables present in

[Assignment Tracking][NFC] Avoid doing some work when maps have same keys

Where the new checks have been added, `SymmetricDifference` - still being built
- contains entries for variables present in `A` and not in `B`. If
`SymmetricDifference` is empty at this point it means the variables (map keys)
in `A` are a subset of those in `B`, so if `A` and `B` are the same size then
we know they're identical.

This reduces the number of instructions retired building some of the CTMark
projects in a ReleaseLTO-g configuration (geomean change -0.05% with the best
improvement being -0.24% for tramp3d-v4)

Reviewed By: StephenTozer

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

show more ...


# b9ae0b09 23-Feb-2023 OCHyams <orlando.hyams@sony.com>

[Assignment Tracking] Initialise maps with minimum required number of entries

The size lower bound is known - the `Join` map in both cases gets an entry for
each variable from both input maps (union

[Assignment Tracking] Initialise maps with minimum required number of entries

The size lower bound is known - the `Join` map in both cases gets an entry for
each variable from both input maps (union).

This reduces the number of times the map grows, improving ReleaseLTO-g compile
time for CTMark projects by an average of around 0.2%.

Reviewed By: scott.linder

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

show more ...


Revision tags: llvmorg-16.0.0-rc3
# 25d0f3c4 10-Feb-2023 OCHyams <orlando.hyams@sony.com>

[Assignment Tracking] Fix fragment index error in getDerefOffsetInBytes

Without this patch `getDerefOffsetInBytes` incorrectly always returns
`std::nullopt` for expressions with fragments due to an

[Assignment Tracking] Fix fragment index error in getDerefOffsetInBytes

Without this patch `getDerefOffsetInBytes` incorrectly always returns
`std::nullopt` for expressions with fragments due to an off-by-one error with
fragment element indices.

Reviewed By: StephenTozer

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

show more ...


Revision tags: llvmorg-16.0.0-rc2, llvmorg-16.0.0-rc1, llvmorg-17-init
# e3a00d51 20-Jan-2023 OCHyams <orlando.hyams@sony.com>

[Assignment Tracking] Fix invalidated iterator usage

The iterator `FirstOverlap` is invalidated after the call to `insert` - avoid
dereferencing the iterator after the call to `insert`.

Reviewed By

[Assignment Tracking] Fix invalidated iterator usage

The iterator `FirstOverlap` is invalidated after the call to `insert` - avoid
dereferencing the iterator after the call to `insert`.

Reviewed By: CarlosAlbertoEnciso

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

show more ...


# 4ece5073 20-Jan-2023 OCHyams <orlando.hyams@sony.com>

[Assignment Tracking][NFC] Replace LLVM command line option with a module flag

Remove LLVM flag -experimental-assignment-tracking. Assignment tracking is
still enabled from Clang with the command li

[Assignment Tracking][NFC] Replace LLVM command line option with a module flag

Remove LLVM flag -experimental-assignment-tracking. Assignment tracking is
still enabled from Clang with the command line -Xclang
-fexperimental-assignment-tracking which tells Clang to ask LLVM to run the
pass declare-to-assign. That pass converts conventional debug intrinsics to
assignment tracking metadata. With this patch it now also sets a module flag
debug-info-assignment-tracking with the value `i1 true` (using the flag conflict
rule `Max` since enabling assignment tracking on IR that contains only
conventional debug intrinsics should cause no issues).

Update the docs and tests too.

Reviewed By: CarlosAlbertoEnciso

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

show more ...


# 12ece768 12-Jan-2023 OCHyams <orlando.hyams@sony.com>

[DebugInfo] Replace UndefValue with PoisonValue in AssignmentTrackingAnalysis

This helps towards the effort to remove UndefValue from LLVM.

Related to https://discourse.llvm.org/t/auto-undef-debug-

[DebugInfo] Replace UndefValue with PoisonValue in AssignmentTrackingAnalysis

This helps towards the effort to remove UndefValue from LLVM.

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

Reviewed By: scott.linder

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

show more ...


Revision tags: llvmorg-15.0.7
# 83f7f86e 11-Jan-2023 OCHyams <orlando.hyams@sony.com>

[NFC][Assignment Tracking] Add is/setKillAddress

Unlike D140903 this patch folds in treating an empty metadata address component
of a dbg.assign the same as undef because it was already being treate

[NFC][Assignment Tracking] Add is/setKillAddress

Unlike D140903 this patch folds in treating an empty metadata address component
of a dbg.assign the same as undef because it was already being treated that way
in the AssignmentTrackingAnalysis pass.

Reviewed By: scott.linder

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

show more ...


# e0e48187 09-Jan-2023 Kazu Hirata <kazu@google.com>

[CodeGen] Fix a warning

This patch fixes:

llvm/lib/CodeGen/AssignmentTrackingAnalysis.cpp:1220:13: error:
unused function 'locStr' [-Werror,-Wunused-function]


# b6942a28 08-Jan-2023 Benjamin Kramer <benny.kra@googlemail.com>

[NFC] Hide implementation details in anonymous namespaces


123