History log of /llvm-project/llvm/lib/Analysis/MemoryLocation.cpp (Results 1 – 25 of 48)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
Revision tags: llvmorg-21-init
# d1314d01 15-Jan-2025 Alex Bradbury <asb@igalia.com>

[MemoryLocation] Teach MemoryLocation about llvm.experimental.memset.pattern (#120421)

Relates to (but isn't dependent on) #120420.

This allows alias analysis o the intrinsic of the same quality

[MemoryLocation] Teach MemoryLocation about llvm.experimental.memset.pattern (#120421)

Relates to (but isn't dependent on) #120420.

This allows alias analysis o the intrinsic of the same quality as for
the libcall, which we want in order to move LoopIdiomRecognize over to
selecting the intrinsic.

show more ...


Revision tags: llvmorg-19.1.7, llvmorg-19.1.6, llvmorg-19.1.5, llvmorg-19.1.4
# 236fda55 06-Nov-2024 Kazu Hirata <kazu@google.com>

[Analysis] Remove unused includes (NFC) (#114936)

Identified with misc-include-cleaner.


Revision tags: llvmorg-19.1.3, llvmorg-19.1.2, llvmorg-19.1.1, 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
# 2d209d96 27-Jun-2024 Nikita Popov <npopov@redhat.com>

[IR] Add getDataLayout() helpers to BasicBlock and Instruction (#96902)

This is a helper to avoid writing `getModule()->getDataLayout()`. I
regularly try to use this method only to remember it does

[IR] Add getDataLayout() helpers to BasicBlock and Instruction (#96902)

This is a helper to avoid writing `getModule()->getDataLayout()`. I
regularly try to use this method only to remember it doesn't exist...

`getModule()->getDataLayout()` is also a common (the most common?)
reason why code has to include the Module.h header.

show more ...


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, 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, 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, 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
# 6006d43e 24-May-2023 Craig Topper <craig.topper@sifive.com>

LLVM_FALLTHROUGH => [[fallthrough]]. NFC

Reviewed By: MaskRay

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


Revision tags: llvmorg-16.0.4, llvmorg-16.0.3, llvmorg-16.0.2, llvmorg-16.0.1, llvmorg-16.0.0, 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
# 46743289 01-Dec-2022 Krzysztof Parzyszek <kparzysz@quicinc.com>

MemoryLocation: convert Optional to std::optional


Revision tags: llvmorg-15.0.6
# 2a324cb2 25-Nov-2022 Kazu Hirata <kazu@google.com>

[Analysis] Use std::optional in MemoryLocation.cpp (NFC)

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

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

[Analysis] Use std::optional in MemoryLocation.cpp (NFC)

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 ...


# ae852750 24-Nov-2022 Florian Hahn <flo@fhahn.com>

[MemoryLocation] Support memcpy_chk in getForArgument.

Similar to 9f9e8ba114ce, add support for memcyp_chk to
MemoryLocation::getForArgument.

The size argument for memcpy_chk is an upper bound for

[MemoryLocation] Support memcpy_chk in getForArgument.

Similar to 9f9e8ba114ce, add support for memcyp_chk to
MemoryLocation::getForArgument.

The size argument for memcpy_chk is an upper bound for the size of the
pointer argument. memcpy_chk may read/write less than the specified length,
if it exceeds the specified max size and aborts.

Reviewed By: xbolva00, jdoerfert

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

show more ...


Revision tags: llvmorg-15.0.5, llvmorg-15.0.4, llvmorg-15.0.3, working, llvmorg-15.0.2, 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, llvmorg-14.0.6, llvmorg-14.0.5, llvmorg-14.0.4, llvmorg-14.0.3, llvmorg-14.0.2, llvmorg-14.0.1, llvmorg-14.0.0, llvmorg-14.0.0-rc4, llvmorg-14.0.0-rc3, llvmorg-14.0.0-rc2
# 71c3a551 28-Feb-2022 serge-sans-paille <sguelton@redhat.com>

Cleanup includes: LLVMAnalysis

Number of lines output by preprocessor:
before: 1065940348
after: 1065307662

Discourse thread: https://discourse.llvm.org/t/include-what-you-use-include-cleanup
Diff

Cleanup includes: LLVMAnalysis

Number of lines output by preprocessor:
before: 1065940348
after: 1065307662

Discourse thread: https://discourse.llvm.org/t/include-what-you-use-include-cleanup
Differential Revision: https://reviews.llvm.org/D120659

show more ...


Revision tags: llvmorg-14.0.0-rc1, llvmorg-15-init, llvmorg-13.0.1, llvmorg-13.0.1-rc3, llvmorg-13.0.1-rc2
# ae64c5a0 23-Dec-2021 Nikita Popov <npopov@redhat.com>

[DSE][MemLoc] Handle intrinsics more generically

Remove the special casing for intrinsics in MemoryLocation::getForDest()
and handle them through the general attribute based code. On the DSE
side, t

[DSE][MemLoc] Handle intrinsics more generically

Remove the special casing for intrinsics in MemoryLocation::getForDest()
and handle them through the general attribute based code. On the DSE
side, this means that isRemovable() now needs to handle more than a
hardcoded list of intrinsics. We consider everything apart from
volatile memory intrinsics and lifetime markers to be removable.

This allows us to perform DSE on intrinsics that DSE has not been
specially taught about, using a matrix store as an example here.

There is an interesting test change for invariant.start, but I
believe that optimization is correct. It only looks a bit odd
because the code is immediate UB anyway.

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

show more ...


# 8a0e35f3 22-Dec-2021 Nikita Popov <npopov@redhat.com>

[MemoryLocation] Don't require nocapture in getForDest()

As reames mentioned on related reviews, we don't need the nocapture
requirement here. First of all, from an API perspective, this is
not some

[MemoryLocation] Don't require nocapture in getForDest()

As reames mentioned on related reviews, we don't need the nocapture
requirement here. First of all, from an API perspective, this is
not something that MemoryLocation::getForDest() should be checking
in the first place, because it does not affect which memory this
particular call can access; it's an orthogonal concern that should
be handled by the caller if necessary.

However, for both of the motivating users in DSE and InstCombine,
we don't need the nocapture requirement, because the capture can
either be purely local to the call (a pointer identity check that
is irrelevant to us), be part of the return value (which we check
is unused), or be written in the dest location, which we have
determined to be dead.

This allows us to remove the special handling for libcalls as well.

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

show more ...


# 44d23d53 21-Dec-2021 Philip Reames <listmail@philipreames.com>

[DSE] Remove calls with known writes to dead memory

This is a reapply of a8a51fe5, which was reverted in 1ba99e due to a failing compiler-rt test. That test was a false positive because it was che

[DSE] Remove calls with known writes to dead memory

This is a reapply of a8a51fe5, which was reverted in 1ba99e due to a failing compiler-rt test. That test was a false positive because it was checking asan failures not accounting for the fact the call could be validly optimized out. I hopefully managed to stablize that test in 9b955f. (That's a speculative fix due to disk consumption needed to build compiler-rt tests locally being absurd.)

Original commit message follows..

The majority of this change is sinking logic from instcombine into MemoryLocation such that it can be generically reused. If we have a call with a single analyzable write to an argument, we can treat that as-if it were a store of unknown size.

Merging the code in this was unblocks DSE in the store to dead memory code paths. In theory, it should also enable classic DSE of such calls, but the code appears to not know how to use object sizes to refine unknown access bounds (yet).

In addition, this does make the isAllocRemovable path slightly stronger by reusing the libfunc and additional intrinsics bits which are already in getForDest.

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

show more ...


# 1ba99eaf 18-Dec-2021 Nikita Popov <npopov@redhat.com>

Revert "[DSE] Remove calls with known writes to dead memory"

This reverts commit a8a51fe55649f5e07f9f2973507dc20bc4e40765.

This breaks the strncpy-overflow.cpp test case.


# a8a51fe5 17-Dec-2021 Philip Reames <listmail@philipreames.com>

[DSE] Remove calls with known writes to dead memory

The majority of this change is sinking logic from instcombine into MemoryLocation such that it can be generically reused. If we have a call with a

[DSE] Remove calls with known writes to dead memory

The majority of this change is sinking logic from instcombine into MemoryLocation such that it can be generically reused. If we have a call with a single analyzable write to an argument, we can treat that as-if it were a store of unknown size.

Merging the code in this was unblocks DSE in the store to dead memory code paths. In theory, it should also enable classic DSE of such calls, but the code appears to not know how to use object sizes to refine unknown access bounds (yet).

In addition, this does make the isAllocRemovable path slightly stronger by reusing the libfunc and additional intrinsics bits which are already in getForDest.

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

show more ...


# ddfac075 14-Dec-2021 Florian Hahn <flo@fhahn.com>

Revert "[MemoryLocation] Handle memset_pattern{4,8,16} in getForDest."

This reverts commit ac60263ad173dbd2eba6e0c8d892d8c3dcc5306c.

It looks like the test fails on certain non-Darwin system, even

Revert "[MemoryLocation] Handle memset_pattern{4,8,16} in getForDest."

This reverts commit ac60263ad173dbd2eba6e0c8d892d8c3dcc5306c.

It looks like the test fails on certain non-Darwin system, even though
the triple is explicitly set to macos. Revert while I investigate.

show more ...


# ac60263a 14-Dec-2021 Florian Hahn <flo@fhahn.com>

[MemoryLocation] Handle memset_pattern{4,8,16} in getForDest.

memset_pattern{4,8,16} writes to the first argument. Use getForDest
to return the corresponding MemoryLocation.

Reviewed By: ab

Differ

[MemoryLocation] Handle memset_pattern{4,8,16} in getForDest.

memset_pattern{4,8,16} writes to the first argument. Use getForDest
to return the corresponding MemoryLocation.

Reviewed By: ab

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

show more ...


# 3c55acc4 08-Dec-2021 Florian Hahn <flo@fhahn.com>

[MemoryLocation] Support memset_pattern{4,8} in getForArgument.

memset_pattern{4,8} behave as memset_pattern16, with the only difference
being the size of the pattern location.

Reviewed By: ab

Dif

[MemoryLocation] Support memset_pattern{4,8} in getForArgument.

memset_pattern{4,8} behave as memset_pattern16, with the only difference
being the size of the pattern location.

Reviewed By: ab

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

show more ...


# 203f29b4 05-Dec-2021 Florian Hahn <flo@fhahn.com>

[MemoryLocation] Use getForArgument in getForSource/getForDest. (NFC)

getForArgument already knows how to extract a memory location for all
memory intrinsics. Use it instead of duplicating the logic.


# a9125792 04-Dec-2021 Florian Hahn <flo@fhahn.com>

[MemoryLocation] Support missing atomic intrinsics in getForArg.

getForArgument is missing support for atomic memory transfer
intrinsics. In terms of accessed locations they behave like regular
memo

[MemoryLocation] Support missing atomic intrinsics in getForArg.

getForArgument is missing support for atomic memory transfer
intrinsics. In terms of accessed locations they behave like regular
memory transfer intrinsics and we already support them as such in
getForSource/getForDest.

show more ...


# ead3979a 03-Dec-2021 Florian Hahn <flo@fhahn.com>

[MemoryLocation] Move DSE intrinsic handling to MemoryLocation. (NFC)

Suggested in D114872.


# af86aa79 03-Dec-2021 Florian Hahn <flo@fhahn.com>

[MemoryLocation] Use None instead of {}. (NFC)


# f078536f 03-Dec-2021 Florian Hahn <flo@fhahn.com>

[MemoryLocation] Move DSE's logic to new MemLoc::getForDest helper (NFC).

DSE has some extra logic to determine the write location of library
calls like str*cpy and str*cat. This patch moves the log

[MemoryLocation] Move DSE's logic to new MemLoc::getForDest helper (NFC).

DSE has some extra logic to determine the write location of library
calls like str*cpy and str*cat. This patch moves the logic to a new
MemoryLocation:getForDest variant, which takes a call and TLI.

This patch should be NFC, because no other places take advantage of the
new helper yet.

Suggested by @reames post-commit 7eec832def571.

Reviewed By: nikic

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

show more ...


# 829b29b6 03-Dec-2021 Florian Hahn <flo@fhahn.com>

[MemoryLocation] strcat/strncat/strcpy read/write after their args.

strcpy/strcat/strncat access memory starting from the passed in
pointers. Construct memory locations for their args using getAfter

[MemoryLocation] strcat/strncat/strcpy read/write after their args.

strcpy/strcat/strncat access memory starting from the passed in
pointers. Construct memory locations for their args using getAfter.

Discussed in D114872.

Reviewed By: reames

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

show more ...


# 639a78a4 02-Dec-2021 Florian Hahn <flo@fhahn.com>

[MemoryLocation] Support strncpy in getForArgument.

The size argument of strncpy can be used as bound for the size of
its pointer arguments.

strncpy is guaranteed to write N bytes and reads up to N

[MemoryLocation] Support strncpy in getForArgument.

The size argument of strncpy can be used as bound for the size of
its pointer arguments.

strncpy is guaranteed to write N bytes and reads up to N bytes.

Reviewed By: xbolva00

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

show more ...


# 9f9e8ba1 02-Dec-2021 Florian Hahn <flo@fhahn.com>

[MemoryLocation] Support memset_chk in getForArgument.

The size argument for memset_chk is an upper bound for the size of the
pointer argument. memset_chk may write less than the specified length,
i

[MemoryLocation] Support memset_chk in getForArgument.

The size argument for memset_chk is an upper bound for the size of the
pointer argument. memset_chk may write less than the specified length,
if it exceeds the specified max size and aborts.

Reviewed By: nikic

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

show more ...


Revision tags: llvmorg-13.0.1-rc1, llvmorg-13.0.0, llvmorg-13.0.0-rc4
# 0fc624f0 15-Sep-2021 Nikita Popov <nikita.ppv@gmail.com>

[IR] Return AAMDNodes from Instruction::getMetadata() (NFC)

getMetadata() currently uses a weird API where it populates a
structure passed to it, and optionally merges into it. Instead,
we can retur

[IR] Return AAMDNodes from Instruction::getMetadata() (NFC)

getMetadata() currently uses a weird API where it populates a
structure passed to it, and optionally merges into it. Instead,
we can return the AAMDNodes and provide a separate merge() API.
This makes usages more compact.

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

show more ...


12