<feed xmlns='http://www.w3.org/2005/Atom'>
<title>llvm-project.git/llvm/lib/Analysis/MemoryBuiltins.cpp, branch main</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.
</subtitle>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/'/>
<entry>
<title>[MemoryBuiltins] Add getBaseObjectSize() (NFCI) (#155911)</title>
<updated>2025-09-01T07:25:56+00:00</updated>
<author>
<name>Nikita Popov</name>
<email>npopov@redhat.com</email>
</author>
<published>2025-09-01T07:25:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=a987022f33a27610732544b0c5f4475ce818c982'/>
<id>a987022f33a27610732544b0c5f4475ce818c982</id>
<content type='text'>
getObjectSize() is based on ObjectSizeOffsetVisitor, which has become
very expensive over time. The implementation is geared towards computing
as-good-as-possible results for the objectsize intrinsics and similar.
However, we also use it in BasicAA, which is very hot, and really only
cares about the base cases like alloca/malloc/global, not any of the
analysis for GEPs, phis, or loads.

Add a new getBaseObjectSize() API for this use case, which only handles
the non-recursive cases. As a bonus, this API can easily return a
TypeSize and thus support scalable vectors. For now, I'm explicitly
discarding the scalable sizes in BasicAA just to avoid unnecessary
behavior changes during this refactor.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
getObjectSize() is based on ObjectSizeOffsetVisitor, which has become
very expensive over time. The implementation is geared towards computing
as-good-as-possible results for the objectsize intrinsics and similar.
However, we also use it in BasicAA, which is very hot, and really only
cares about the base cases like alloca/malloc/global, not any of the
analysis for GEPs, phis, or loads.

Add a new getBaseObjectSize() API for this use case, which only handles
the non-recursive cases. As a bonus, this API can easily return a
TypeSize and thus support scalable vectors. For now, I'm explicitly
discarding the scalable sizes in BasicAA just to avoid unnecessary
behavior changes during this refactor.</pre>
</div>
</content>
</entry>
<entry>
<title>[MemoryBuiltins] Support allocas in getInitialValueOfAllocation (NFC)</title>
<updated>2025-06-16T09:52:16+00:00</updated>
<author>
<name>Nikita Popov</name>
<email>npopov@redhat.com</email>
</author>
<published>2025-06-16T09:48:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=3824a2dbcefe266849b9f8b3eaa1dd23354b15de'/>
<id>3824a2dbcefe266849b9f8b3eaa1dd23354b15de</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>[llvm] Bail out when meeting pointer with negative offset in approximated mode instead of … (#120424)</title>
<updated>2024-12-20T12:16:49+00:00</updated>
<author>
<name>serge-sans-paille</name>
<email>sguelton@mozilla.com</email>
</author>
<published>2024-12-20T12:16:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=e4db3f0d97681a10a76e71465f1379801cd45f54'/>
<id>e4db3f0d97681a10a76e71465f1379801cd45f54</id>
<content type='text'>
…generating empty location

Fix the regression detected by
https://github.com/llvm/llvm-test-suite/pull/188</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
…generating empty location

Fix the regression detected by
https://github.com/llvm/llvm-test-suite/pull/188</pre>
</div>
</content>
</entry>
<entry>
<title>[llvm] Improve llvm.objectsize computation by computing GEP, alloca a… (#117849)</title>
<updated>2024-12-10T06:28:03+00:00</updated>
<author>
<name>serge-sans-paille</name>
<email>sguelton@mozilla.com</email>
</author>
<published>2024-12-10T06:28:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=f8c1a22220345dc85bf700c8a8ca6a28839edabb'/>
<id>f8c1a22220345dc85bf700c8a8ca6a28839edabb</id>
<content type='text'>
…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.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
…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.</pre>
</div>
</content>
</entry>
<entry>
<title>[llvm] Fix ObjectSizeOffsetVisitor behavior in exact mode upon negati… (#116955)</title>
<updated>2024-11-23T07:38:37+00:00</updated>
<author>
<name>serge-sans-paille</name>
<email>sguelton@mozilla.com</email>
</author>
<published>2024-11-23T07:38:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=19ddafafdf131aed40abbdaf5af1fb7b59c1e8ac'/>
<id>19ddafafdf131aed40abbdaf5af1fb7b59c1e8ac</id>
<content type='text'>
…ve offset

In Exact mode, the approximation of returning (0,0) is invalid. It only
holds in min/max mode.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
…ve offset

In Exact mode, the approximation of returning (0,0) is invalid. It only
holds in min/max mode.</pre>
</div>
</content>
</entry>
<entry>
<title>Revert "[llvm] Improve llvm.objectsize computation by computing GEP, alloca and malloc parameters bound" (#117020)</title>
<updated>2024-11-20T22:21:09+00:00</updated>
<author>
<name>Florian Mayer</name>
<email>fmayer@google.com</email>
</author>
<published>2024-11-20T22:21:09+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=a44d60f06fe1381e261e3da5c47ddab1c428a67a'/>
<id>a44d60f06fe1381e261e3da5c47ddab1c428a67a</id>
<content type='text'>
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</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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</pre>
</div>
</content>
</entry>
<entry>
<title>[llvm] Improve llvm.objectsize computation by computing GEP, alloca and malloc parameters bound (#115522)</title>
<updated>2024-11-19T07:45:18+00:00</updated>
<author>
<name>serge-sans-paille</name>
<email>sguelton@mozilla.com</email>
</author>
<published>2024-11-19T07:45:18+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=02b8ee281947f6cb39c7eb3c4bbba59322e9015b'/>
<id>02b8ee281947f6cb39c7eb3c4bbba59322e9015b</id>
<content type='text'>
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.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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.</pre>
</div>
</content>
</entry>
<entry>
<title>[llvm] Fix behavior of llvm.objectsize in presence of negative / large offset (#115504)</title>
<updated>2024-11-18T07:39:04+00:00</updated>
<author>
<name>serge-sans-paille</name>
<email>sguelton@mozilla.com</email>
</author>
<published>2024-11-18T07:39:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=1dcb3db0ac1255bf556bf6b62d03a113bd5191d8'/>
<id>1dcb3db0ac1255bf556bf6b62d03a113bd5191d8</id>
<content type='text'>
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.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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.</pre>
</div>
</content>
</entry>
<entry>
<title>Revert "[llvm] Use computeConstantRange to improve llvm.objectsize computation (#114673)"</title>
<updated>2024-11-07T12:40:50+00:00</updated>
<author>
<name>serge-sans-paille</name>
<email>sguelton@mozilla.com</email>
</author>
<published>2024-11-07T12:39:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=f5e4ffaa49254706ad6fa209de8aec28e20f0041'/>
<id>f5e4ffaa49254706ad6fa209de8aec28e20f0041</id>
<content type='text'>
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
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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
</pre>
</div>
</content>
</entry>
<entry>
<title>[llvm] Use computeConstantRange to improve llvm.objectsize computation (#114673)</title>
<updated>2024-11-07T09:01:14+00:00</updated>
<author>
<name>serge-sans-paille</name>
<email>sguelton@mozilla.com</email>
</author>
<published>2024-11-07T09:01:14+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=5f342816efe1854333f2be41a03fdd25fa0db433'/>
<id>5f342816efe1854333f2be41a03fdd25fa0db433</id>
<content type='text'>
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.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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.</pre>
</div>
</content>
</entry>
</feed>
