History log of /llvm-project/llvm/lib/Analysis/BasicAliasAnalysis.cpp (Results 76 – 100 of 785)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# 60990d90 14-Sep-2022 Nikita Popov <npopov@redhat.com>

[BasicAA] Move experimental.guard modelling to getModRefBehavior()

While we can't express this with attributes yet, we can model
these intrinsics as readonly + writing inaccessible memory (for
the c

[BasicAA] Move experimental.guard modelling to getModRefBehavior()

While we can't express this with attributes yet, we can model
these intrinsics as readonly + writing inaccessible memory (for
the control dependence) in FMRB. This way we don't need to
special-case them in getModRefInfo(), it falls out of the usual
logic.

show more ...


# ab25ea6d 01-Sep-2022 Nikita Popov <npopov@redhat.com>

[AA] Model operand bundles more precisely

Based on D130896, we can model operand bundles more precisely. In
addition to the baseline ModRefBehavior, a reading/clobbering operand
bundle may also read

[AA] Model operand bundles more precisely

Based on D130896, we can model operand bundles more precisely. In
addition to the baseline ModRefBehavior, a reading/clobbering operand
bundle may also read/write all locations. For example, a memcpy with
deopt bundle can read any memory, but only write argument memory.

This means that getModRefInfo() for memcpy with a pointer that does
not alias the arguments results in Ref, rather than ModRef, without
the need to implement any special handling.

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

show more ...


# b1cd393f 28-Jul-2022 Nikita Popov <npopov@redhat.com>

[AA] Tracking per-location ModRef info in FunctionModRefBehavior (NFCI)

Currently, FunctionModRefBehavior tracks whether the function reads
or writes memory (ModRefInfo) and which locations it can a

[AA] Tracking per-location ModRef info in FunctionModRefBehavior (NFCI)

Currently, FunctionModRefBehavior tracks whether the function reads
or writes memory (ModRefInfo) and which locations it can access
(argmem, inaccessiblemem and other). This patch changes it to track
ModRef information per-location instead.

To give two examples of why this is useful:

* D117095 highlights a weakness of ModRef modelling in the presence
of operand bundles. For a memcpy call with deopt operand bundle,
we want to say that it can read any memory, but only write argument
memory. This would allow them to be treated like any other calls.
However, we currently can't express this and have to say that it
can read or write any memory.
* D127383 would ideally be modelled as a separate threadid location,
where threadid Refs outside pre-split coroutines can be ignored
(like other accesses to constant memory). The current representation
does not allow modelling this precisely.

The patch as implemented is intended to be NFC, but there are some
obvious opportunities for improvements and simplification. To fully
capitalize on this we would also want to change the way we represent
memory attributes on functions, but that's a larger change, and I
think it makes sense to separate out the FunctionModRefBehavior
refactoring.

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

show more ...


# 31cc0ab3 12-Sep-2022 Nikita Popov <npopov@redhat.com>

[BasicAA] Delay getAllocTypeSize() call (NFC)

This call is expensive, so don't perform it for zero indices.

Also rename the variable to use Alloc rather than Alloca, this
doesn't have anything to d

[BasicAA] Delay getAllocTypeSize() call (NFC)

This call is expensive, so don't perform it for zero indices.

Also rename the variable to use Alloc rather than Alloca, this
doesn't have anything to do with allocas in particular.

show more ...


# 8a15695b 12-Sep-2022 zhongyunde <zhongyunde@huawei.com>

[AA] Improve the BasicAA analysis capability

According https://discourse.llvm.org/t/memoryssa-does-the-accessedbetween-support-scalable-vector-pointer/65052,
scalable vector support in BasicAA is cu

[AA] Improve the BasicAA analysis capability

According https://discourse.llvm.org/t/memoryssa-does-the-accessedbetween-support-scalable-vector-pointer/65052,
scalable vector support in BasicAA is currently essentially limited,
and should be improved effectively for a constant offset GEP if the scalable index is zero, eg:
getelementptr <vscale x 4 x i32>, ptr %p, i64 0, i64 %i

Reviewed By: nikic
Differential Revision: https://reviews.llvm.org/D133567

show more ...


# de9d80c1 08-Aug-2022 Fangrui Song <i@maskray.me>

[llvm] LLVM_FALLTHROUGH => [[fallthrough]]. NFC

With C++17 there is no Clang pedantic warning or MSVC C5051.


# b128e057 01-Aug-2022 Nikita Popov <npopov@redhat.com>

[AA] Make ModRefInfo a bitmask enum (NFC)

Mark ModRefInfo as a bitmask enum, which allows using normal
& and | operators on it. This supersedes various functions like
unionModRef() and intersectModR

[AA] Make ModRefInfo a bitmask enum (NFC)

Mark ModRefInfo as a bitmask enum, which allows using normal
& and | operators on it. This supersedes various functions like
unionModRef() and intersectModRef(). I think this makes the code
cleaner than going through helper functions...

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

show more ...


# f96ea53e 28-Jul-2022 Nikita Popov <npopov@redhat.com>

[AA] Do not track Must in ModRefInfo

getModRefInfo() queries currently track whether the result is a
MustAlias on a best-effort basis. The only user of this functionality
is the optimized memory acc

[AA] Do not track Must in ModRefInfo

getModRefInfo() queries currently track whether the result is a
MustAlias on a best-effort basis. The only user of this functionality
is the optimized memory access type in MemorySSA -- which in turn
has no users. Given that this functionality has not found a user
since it was introduced five years ago (in D38862), I think we
should drop it again.

The context is that I'm working to separate FunctionModRefBehavior
to track mod/ref for different location kinds (like argmem or
inaccessiblemem) separately, and the fact that ModRefInfo also has
an unrelated Must flag makes this quite awkward, especially as this
means that NoModRef is not a zero value. If we want to retain the
functionality, I would probably split getModRefInfo() results into
a part that just contains the ModRef information, and a separate
part containing a (best-effort) AliasResult.

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

show more ...


# 645d2dd3 20-Jul-2022 Chuanqi Xu <yedeng.yd@linux.alibaba.com>

Revert "Don't treat readnone call in presplit coroutine as not access memory"

This reverts commit 57224ff4a6833dca1f17568cc9cf77f9579030ae. This
commit may trigger crashes on some workloads. Revert

Revert "Don't treat readnone call in presplit coroutine as not access memory"

This reverts commit 57224ff4a6833dca1f17568cc9cf77f9579030ae. This
commit may trigger crashes on some workloads. Revert it for clearness.

show more ...


# 57224ff4 20-Jul-2022 Chuanqi Xu <yedeng.yd@linux.alibaba.com>

Don't treat readnone call in presplit coroutine as not access memory

To solve the readnone problems in coroutines. See
https://discourse.llvm.org/t/address-thread-identification-problems-with-corout

Don't treat readnone call in presplit coroutine as not access memory

To solve the readnone problems in coroutines. See
https://discourse.llvm.org/t/address-thread-identification-problems-with-coroutine/62015
for details.

According to the discussion, we decide to fix the problem by inserting
isPresplitCoroutine() checks in different passes instead of
wrapping/unwrapping readnone attributes in CoroEarly/CoroCleanup passes.
In this direction, we might not be able to cover every case at first.
Let's take a "find and fix" strategy.

Reviewed By: nikic, nhaehnle, jyknight

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

show more ...


# 601b3a13 17-Jul-2022 Kazu Hirata <kazu@google.com>

[Analysis] Qualify auto variables in for loops (NFC)


# 54eff7da 24-Jun-2022 Nikita Popov <npopov@redhat.com>

[AA] Export isEscapeSource() API (NFC)

Export API that was previously private to BasicAliasAnalysis and
will be used in D127202.


# bcadfc25 23-Jun-2022 Nikita Popov <npopov@redhat.com>

[BasicAA] Handle passthru calls in isEscapeSource()

isEscapeSource() currently considers all call return values as
escape sources. However, CaptureTracking can look through certain
calls, so we shou

[BasicAA] Handle passthru calls in isEscapeSource()

isEscapeSource() currently considers all call return values as
escape sources. However, CaptureTracking can look through certain
calls, so we shouldn't consider these as escape sources either.

The corresponding CaptureTracking code is:
https://github.com/llvm/llvm-project/blob/7c9a3825b8420f5d37c5bb8919a9e46684a87089/llvm/lib/Analysis/CaptureTracking.cpp#L332-L333

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

show more ...


# 6bec3e93 06-Oct-2021 Jay Foad <jay.foad@amd.com>

[APInt] Remove all uses of zextOrSelf, sextOrSelf and truncOrSelf

Most clients only used these methods because they wanted to be able to
extend or truncate to the same bit width (which is a no-op).

[APInt] Remove all uses of zextOrSelf, sextOrSelf and truncOrSelf

Most clients only used these methods because they wanted to be able to
extend or truncate to the same bit width (which is a no-op). Now that
the standard zext, sext and trunc allow this, there is no reason to use
the OrSelf versions.

The OrSelf versions additionally have the strange behaviour of allowing
extending to a *smaller* width, or truncating to a *larger* width, which
are also treated as no-ops. A small amount of client code relied on this
(ConstantRange::castOp and MicrosoftCXXNameMangler::mangleNumber) and
needed rewriting.

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

show more ...


# f7988d08 18-May-2022 Philip Reames <listmail@philipreames.com>

Revert "[BasicAA] Remove unneeded special case for malloc/calloc"

This reverts commit 9b1e00738c5ddba681e17e5cb7c260d9afc4c3a7.

Nikic reported in commit thread that I had forgotten history here, an

Revert "[BasicAA] Remove unneeded special case for malloc/calloc"

This reverts commit 9b1e00738c5ddba681e17e5cb7c260d9afc4c3a7.

Nikic reported in commit thread that I had forgotten history here, and that a) we'd tried this before, and b) had to revert due to an unexpected codegen impact. Current measurements confirm the same issue still exists.

show more ...


# 9b1e0073 18-May-2022 Philip Reames <listmail@philipreames.com>

[BasicAA] Remove unneeded special case for malloc/calloc

This code pre-exists the generic handling for inaccessiblememonly. If we remove it and update one test with inaccessiblememonly, nothing els

[BasicAA] Remove unneeded special case for malloc/calloc

This code pre-exists the generic handling for inaccessiblememonly. If we remove it and update one test with inaccessiblememonly, nothing else changes. Note that simply running O1 on that test would annotate malloc with the missing inaccessiblememonly.

show more ...


# 7e0802ae 10-May-2022 Arthur Eubanks <aeubanks@google.com>

[BasicAA] Fix order in which we pass MemoryLocations to alias()

D98718 caused the order of Values/MemoryLocations we pass to alias() to
be significant due to storing the offset in the PartialAlias c

[BasicAA] Fix order in which we pass MemoryLocations to alias()

D98718 caused the order of Values/MemoryLocations we pass to alias() to
be significant due to storing the offset in the PartialAlias case. But
some callers weren't audited and were still passing swapped arguments,
causing the returned PartialAlias offset to be negative in some
cases. For example, the newly added unittests would return -1
instead of 1.

Fixes #55343, a miscompile.

Reviewed By: asbirlea, nikic

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

show more ...


# b22ffc7b 07-Apr-2022 Arthur Eubanks <aeubanks@google.com>

[CaptureTracking] Ignore ephemeral values in EarliestEscapeInfo

And thread DSE's ephemeral values to EarliestEscapeInfo.

This allows more precise analysis in DSEState::isReadClobber() via BatchAA.

[CaptureTracking] Ignore ephemeral values in EarliestEscapeInfo

And thread DSE's ephemeral values to EarliestEscapeInfo.

This allows more precise analysis in DSEState::isReadClobber() via BatchAA.

Followup to D123162.

Reviewed By: nikic

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

show more ...


# 1b7ef6aa 18-Mar-2022 Florian Hahn <flo@fhahn.com>

[BasicAA] Account for wrapping when using abs(VarIndex) >= abs(Scale).

The patch adds an extra check to only set MinAbsVarIndex if
abs(V * Scale) won't wrap. In the absence of IsNSW, try to use the

[BasicAA] Account for wrapping when using abs(VarIndex) >= abs(Scale).

The patch adds an extra check to only set MinAbsVarIndex if
abs(V * Scale) won't wrap. In the absence of IsNSW, try to use the
bitwidths of the original V and Scale to rule out wrapping.

Attempt to model https://alive2.llvm.org/ce/z/HE8ZKj

The code in the else if below probably needs the same treatment, but I
need to come up with a test first.

Reviewed By: asbirlea

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

show more ...


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


# d7424939 24-Jan-2022 Evgeniy Brevnov <ybrevnov@azul.com>

[BasicAA] Add support for memmove intrinsic

Currently, basic AA has special support for llvm.memcpy.* intrinsics. This change extends this support for any memory trancsfer opration and in particular

[BasicAA] Add support for memmove intrinsic

Currently, basic AA has special support for llvm.memcpy.* intrinsics. This change extends this support for any memory trancsfer opration and in particular llvm.memmove.* intrinsic.

Reviewed By: reames, nikic

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

show more ...


# 0e55d4fa 24-Jan-2022 Evgeniy Brevnov <ybrevnov@azul.com>

[AA] Refine ModRefInfo for llvm.memcpy.* in presence of operand bundles

Presence of operand bundles changes semantics in respect to ModRef. In particular, spec says: "From the compilers perspective,

[AA] Refine ModRefInfo for llvm.memcpy.* in presence of operand bundles

Presence of operand bundles changes semantics in respect to ModRef. In particular, spec says: "From the compilers perspective, deoptimization operand bundles make the call sites theyre attached to at least readonly. They read through all of their pointer typed operands (even if theyre not otherwise escaped) and the entire visible heap. Deoptimization operand bundles do not capture their operands except during deoptimization, in which case control will not be returned to the compiled frame". Fix handling of llvm.memcpy.* according to the spec.

Reviewed By: nikic

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

show more ...


# dd13744b 14-Jan-2022 Bryce Wilson <bryce@brycemw.ca>

Revert "[BasicAliasAnalysis] Remove isMallocOrCallocLikeFn"

This reverts commit 1f2cfc4fdc1eefb2c5f562c77a5fe7e916bbf670.


# 1f2cfc4f 13-Jan-2022 Bryce Wilson <bryce@brycemw.ca>

[BasicAliasAnalysis] Remove isMallocOrCallocLikeFn

Allocation functions should be marked with onlyAccessesInaccessibleMemory (when that is correct for the given function) which is checked elsewhere

[BasicAliasAnalysis] Remove isMallocOrCallocLikeFn

Allocation functions should be marked with onlyAccessesInaccessibleMemory (when that is correct for the given function) which is checked elsewhere so this check is no longer needed.

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

show more ...


# c16fd6a3 05-Jan-2022 Philip Reames <listmail@philipreames.com>

Rename doesNotReadMemory to onlyWritesMemory globally [NFC]

The naming has come up as a source of confusion in several recent reviews. onlyWritesMemory is consist with onlyReadsMemory which we use

Rename doesNotReadMemory to onlyWritesMemory globally [NFC]

The naming has come up as a source of confusion in several recent reviews. onlyWritesMemory is consist with onlyReadsMemory which we use for the corresponding readonly case as well.

show more ...


12345678910>>...32