History log of /llvm-project/llvm/lib/Analysis/MemoryBuiltins.cpp (Results 1 – 25 of 288)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
Revision tags: llvmorg-21-init, llvmorg-19.1.7
# e4db3f0d 20-Dec-2024 serge-sans-paille <sguelton@mozilla.com>

[llvm] Bail out when meeting pointer with negative offset in approximated mode instead of … (#120424)

…generating empty location

Fix the regression detected by
https://github.com/llvm/llvm-test-

[llvm] Bail out when meeting pointer with negative offset in approximated mode instead of … (#120424)

…generating empty location

Fix the regression detected by
https://github.com/llvm/llvm-test-suite/pull/188

show more ...


Revision tags: llvmorg-19.1.6
# f8c1a222 10-Dec-2024 serge-sans-paille <sguelton@mozilla.com>

[llvm] Improve llvm.objectsize computation by computing GEP, alloca a… (#117849)

…nd malloc parameters bound

Using a naive expression walker, it is possible to compute valuable
information for a

[llvm] Improve llvm.objectsize computation by computing GEP, alloca a… (#117849)

…nd malloc parameters bound

Using a naive expression walker, it is possible to compute valuable
information for allocation functions, GEP and alloca, even in the
presence of some dynamic information.

We don't rely on computeConstantRange to avoid taking advantage of
undefined behavior, which would be counter-productive wrt. usual
llvm.objectsize usage.

llvm.objectsize plays an important role in _FORTIFY_SOURCE definitions,
so improving its diagnostic in turns improves the security of compiled
application.

As a side note, as a result of recent optimization improvements, clang
no longer passes
https://github.com/serge-sans-paille/builtin_object_size-test-suite This
commit restores the situation and greatly improves the scope of code
handled by the static version of __builtin_object_size.

This is a recommit of https://github.com/llvm/llvm-project/pull/115522
with fix applied.

show more ...


Revision tags: llvmorg-19.1.5
# 19ddafaf 23-Nov-2024 serge-sans-paille <sguelton@mozilla.com>

[llvm] Fix ObjectSizeOffsetVisitor behavior in exact mode upon negati… (#116955)

…ve offset

In Exact mode, the approximation of returning (0,0) is invalid. It only
holds in min/max mode.


# a44d60f0 20-Nov-2024 Florian Mayer <fmayer@google.com>

Revert "[llvm] Improve llvm.objectsize computation by computing GEP, alloca and malloc parameters bound" (#117020)

Reverts llvm/llvm-project#115522

This caused UBSan errors in multi-stage clang b

Revert "[llvm] Improve llvm.objectsize computation by computing GEP, alloca and malloc parameters bound" (#117020)

Reverts llvm/llvm-project#115522

This caused UBSan errors in multi-stage clang build:

https://lab.llvm.org/buildbot/#/builders/25/builds/4241/steps/10/logs/stdio

show more ...


Revision tags: llvmorg-19.1.4
# 02b8ee28 19-Nov-2024 serge-sans-paille <sguelton@mozilla.com>

[llvm] Improve llvm.objectsize computation by computing GEP, alloca and malloc parameters bound (#115522)

Using a naive expression walker, it is possible to compute valuable
information for
alloca

[llvm] Improve llvm.objectsize computation by computing GEP, alloca and malloc parameters bound (#115522)

Using a naive expression walker, it is possible to compute valuable
information for
allocation functions, GEP and alloca, even in the presence of some
dynamic
information.

We don't rely on computeConstantRange to avoid taking advantage of
undefined behavior, which would be counter-productive wrt. usual
llvm.objectsize usage.

llvm.objectsize plays an important role in _FORTIFY_SOURCE definitions,
so improving its diagnostic in turns improves the security of compiled
application.

As a side note, as a result of recent optimization improvements, clang
no
longer passes
https://github.com/serge-sans-paille/builtin_object_size-test-suite
This commit restores the situation and greatly improves the scope of
code handled by the static version of __builtin_object_size.

show more ...


# 1dcb3db0 18-Nov-2024 serge-sans-paille <sguelton@mozilla.com>

[llvm] Fix behavior of llvm.objectsize in presence of negative / large offset (#115504)

The internal structure used to carry intermediate computations hold
signed values. If an object size happens

[llvm] Fix behavior of llvm.objectsize in presence of negative / large offset (#115504)

The internal structure used to carry intermediate computations hold
signed values. If an object size happens to overflow signed values, we
can get invalid result, so make sure this situation never happens.

This is not very limitative as static allocation of such large values
should scarcely happen.

show more ...


# f5e4ffaa 07-Nov-2024 serge-sans-paille <sguelton@mozilla.com>

Revert "[llvm] Use computeConstantRange to improve llvm.objectsize computation (#114673)"

This reverts commit 5f342816efe1854333f2be41a03fdd25fa0db433.

This seems to break various builders, such as

Revert "[llvm] Use computeConstantRange to improve llvm.objectsize computation (#114673)"

This reverts commit 5f342816efe1854333f2be41a03fdd25fa0db433.

This seems to break various builders, such as

https://lab.llvm.org/buildbot/#/builders/41/builds/3259
https://lab.llvm.org/buildbot/#/builders/76/builds/4298

show more ...


# 5f342816 07-Nov-2024 serge-sans-paille <sguelton@mozilla.com>

[llvm] Use computeConstantRange to improve llvm.objectsize computation (#114673)

Using LazyValueInfo, it is possible to compute valuable information for
allocation functions, GEP and alloca, even i

[llvm] Use computeConstantRange to improve llvm.objectsize computation (#114673)

Using LazyValueInfo, it is possible to compute valuable information for
allocation functions, GEP and alloca, even in the presence of dynamic
information.

llvm.objectsize plays an important role in _FORTIFY_SOURCE definitions,
so improving its diagnostic in turns improves the security of compiled
application.

As a side note, as a result of recent optimization improvements, clang
no longer passes
https://github.com/serge-sans-paille/builtin_object_size-test-suite This
commit restores the situation and greatly improves the scope of code
handled by the static version of __builtin_object_size.

show more ...


# 236fda55 06-Nov-2024 Kazu Hirata <kazu@google.com>

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

Identified with misc-include-cleaner.


# 01a103b0 02-Nov-2024 serge-sans-paille <sguelton@mozilla.com>

[llvm] Fix __builtin_object_size interaction between Negative Offset … (#111827)

…and Select/Phi

When picking a SizeOffsetAPInt through combineSizeOffset, the behavior
differs if we're going to

[llvm] Fix __builtin_object_size interaction between Negative Offset … (#111827)

…and Select/Phi

When picking a SizeOffsetAPInt through combineSizeOffset, the behavior
differs if we're going to apply a constant offset that's positive or
negative: If it's positive, then we need to compare the remaining bytes
(i.e. Size
- Offset), but if it's negative, we need to compare the preceding bytes
(i.e. Offset).

Fix #111709

show more ...


Revision tags: llvmorg-19.1.3
# 255a99c2 17-Oct-2024 Nikita Popov <npopov@redhat.com>

[APInt] Fix APInt constructions where value does not fit bitwidth (NFCI) (#80309)

This fixes all the places that hit the new assertion added in
https://github.com/llvm/llvm-project/pull/106524 in t

[APInt] Fix APInt constructions where value does not fit bitwidth (NFCI) (#80309)

This fixes all the places that hit the new assertion added in
https://github.com/llvm/llvm-project/pull/106524 in tests. That is,
cases where the value passed to the APInt constructor is not an N-bit
signed/unsigned integer, where N is the bit width and signedness is
determined by the isSigned flag.

The fixes either set the correct value for isSigned, set the
implicitTrunc flag, or perform more calculations inside APInt.

Note that the assertion is currently still disabled by default, so this
patch is mostly NFC.

show more ...


Revision tags: llvmorg-19.1.2, llvmorg-19.1.1, llvmorg-19.1.0, llvmorg-19.1.0-rc4, llvmorg-19.1.0-rc3
# 53c41f95 13-Aug-2024 Nikita Popov <npopov@redhat.com>

[MemoryBuiltins] Use getAllOnesValue()

Split out from https://github.com/llvm/llvm-project/pull/80309.


# 5bc1f9e5 09-Aug-2024 Nikita Popov <npopov@redhat.com>

[MemoryBuiltins] Simplify getCalledFunction() helper (NFC)

If nobuiltin is set, directly return nullptr instead of using a
separate out parameter and having all callers check this.


# 19536292 09-Aug-2024 Nikita Popov <npopov@redhat.com>

[MemoryBuiltins] Handle allocator attributes on call-site

We should handle allocator attributes not only on function
declarations, but also on the call-site. That way we can e.g.
also optimize cases

[MemoryBuiltins] Handle allocator attributes on call-site

We should handle allocator attributes not only on function
declarations, but also on the call-site. That way we can e.g.
also optimize cases where the allocator function is a virtual
function call.

This was already supported in some of the MemoryBuiltins helpers,
but not all of them. This adds support for allocsize, alloc-family
and allockind("free").

show more ...


Revision tags: 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 ...


# d75f9dd1 24-Jun-2024 Stephen Tozer <stephen.tozer@sony.com>

Revert "[IR][NFC] Update IRBuilder to use InsertPosition (#96497)"

Reverts the above commit, as it updates a common header function and
did not update all callsites:

https://lab.llvm.org/buildbot

Revert "[IR][NFC] Update IRBuilder to use InsertPosition (#96497)"

Reverts the above commit, as it updates a common header function and
did not update all callsites:

https://lab.llvm.org/buildbot/#/builders/29/builds/382

This reverts commit 6481dc57612671ebe77fe9c34214fba94e1b3b27.

show more ...


# 6481dc57 24-Jun-2024 Stephen Tozer <stephen.tozer@sony.com>

[IR][NFC] Update IRBuilder to use InsertPosition (#96497)

Uses the new InsertPosition class (added in #94226) to simplify some of
the IRBuilder interface, and removes the need to pass a BasicBlock

[IR][NFC] Update IRBuilder to use InsertPosition (#96497)

Uses the new InsertPosition class (added in #94226) to simplify some of
the IRBuilder interface, and removes the need to pass a BasicBlock
alongside a BasicBlock::iterator, using the fact that we can now get the
parent basic block from the iterator even if it points to the sentinel.
This patch removes the BasicBlock argument from each constructor or call
to setInsertPoint.

This has no functional effect, but later on as we look to remove the
`Instruction *InsertBefore` argument from instruction-creation
(discussed
[here](https://discourse.llvm.org/t/psa-instruction-constructors-changing-to-iterator-only-insertion/77845)),
this will simplify the process by allowing us to deprecate the
InsertPosition constructor directly and catch all the cases where we use
instructions rather than iterators.

show more ...


Revision tags: llvmorg-18.1.8, llvmorg-18.1.7, llvmorg-18.1.6
# 43a38e27 03-May-2024 Vitaly Buka <vitalybuka@google.com>

[BoundsChecking] Handle vscale allocas (#90926)


Revision tags: 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
# fc6b5666 06-Jan-2024 Bill Wendling <5993918+bwendling@users.noreply.github.com>

[NFC][ObjectSizeOffset] Use classes instead of std::pair (#76882)

The use of std::pair makes the values it holds opaque. Using classes
improves this while keeping the POD aspect of a std::pair. As

[NFC][ObjectSizeOffset] Use classes instead of std::pair (#76882)

The use of std::pair makes the values it holds opaque. Using classes
improves this while keeping the POD aspect of a std::pair. As a nice
addition, the "known" functions held inappropriately in the Visitor
classes can now properly reside in the value classes. :-)

show more ...


Revision tags: llvmorg-17.0.6, llvmorg-17.0.5, llvmorg-17.0.4
# 180eae1f 19-Oct-2023 Nikita Popov <npopov@redhat.com>

[MemoryBuiltins] Simplify getAllocFnKind() implementation (NFC)


Revision tags: llvmorg-17.0.3, llvmorg-17.0.2
# cf7eac96 27-Sep-2023 Arthur Eubanks <aeubanks@google.com>

[ObjectSizeOffsetVisitor] Bail after visiting 100 instructions (#67479)

We're running into stack overflows for huge functions with lots of phis.
Even without the stack overflows, this is recursing

[ObjectSizeOffsetVisitor] Bail after visiting 100 instructions (#67479)

We're running into stack overflows for huge functions with lots of phis.
Even without the stack overflows, this is recursing >7000 in some
auto-generated code.

This fixes the stack overflow and brings down the compile time to
something reasonable.

show more ...


# 0944eea8 22-Sep-2023 Arthur Eubanks <aeubanks@google.com>

[NFC][ObjectSizeOffsetVisitor] Remove redundant equality check

Originally suggested in https://reviews.llvm.org/D131001 but I accidentally took only have of the suggestion.


Revision tags: llvmorg-17.0.1, llvmorg-17.0.0
# e4126974 15-Sep-2023 Bevin Hansson <59652494+bevin-hansson@users.noreply.github.com>

[MemoryBuiltins] Cache the result of ObjectOffsetSizeVisitor::visit. #64796 (#65326)

visit will skip visiting instructions it already has visited
to avoid issues with cycles in the data graph. Howe

[MemoryBuiltins] Cache the result of ObjectOffsetSizeVisitor::visit. #64796 (#65326)

visit will skip visiting instructions it already has visited
to avoid issues with cycles in the data graph. However,
the result of this skipping behavior is that if we
encounter the same instruction twice, and that instruction
has a well defined result and isn't part of a cycle, we
will introduce unknowns into the analysis even though we
knew the size and offset of the instruction's result.

Instead of skipping such instructions, keep a cache of
the result of visiting them. This result is initialized
to unknown() before visiting, so if we happen to visit
it again recursively (perhaps as the result of a cycle
or a phi), we will get unknown as the cached result and
exit out.

show more ...


# e54277fa 11-Sep-2023 Jeremy Morse <jeremy.morse@sony.com>

[NFC][RemoveDIs] Use iterators over inst-pointers when using IRBuilder

This patch adds a two-argument SetInsertPoint method to IRBuilder that
takes a block/iterator instead of an instruction, and up

[NFC][RemoveDIs] Use iterators over inst-pointers when using IRBuilder

This patch adds a two-argument SetInsertPoint method to IRBuilder that
takes a block/iterator instead of an instruction, and updates many call
sites to use it. The motivating reason for doing this is given here [0],
we'd like to pass around more information about the position of debug-info
in the iterator object. That necessitates passing iterators around most of
the time.

[0] https://discourse.llvm.org/t/rfc-instruction-api-changes-needed-to-eliminate-debug-intrinsics-from-ir/68939

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

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
# e578b3be 03-Jul-2023 Anshil Gandhi <gandhi21299@gmail.com>

[InstSimplify] Fold all global variables with initializers

Allow computing size of interposable or externally initializable global variables.

Reviewed By: nikic

Differential Revision: https://revi

[InstSimplify] Fold all global variables with initializers

Allow computing size of interposable or externally initializable global variables.

Reviewed By: nikic

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

show more ...


12345678910>>...12