<feed xmlns='http://www.w3.org/2005/Atom'>
<title>llvm-project.git/clang/lib/AST/ByteCode/Integral.h, branch users/mingmingl-llvm/samplefdo-profile-format</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>[clang][bytecode] Support remaining add_sat like X86 builtins (#155358)</title>
<updated>2025-08-26T11:51:30+00:00</updated>
<author>
<name>Timm Baeder</name>
<email>tbaeder@redhat.com</email>
</author>
<published>2025-08-26T11:51:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=773e6c3a3563421e1ae8c0093d03a5de8a3139c2'/>
<id>773e6c3a3563421e1ae8c0093d03a5de8a3139c2</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Reapply "Reapply "[clang][bytecode] Allocate IntegralAP and Floating … (#145014)</title>
<updated>2025-06-20T16:06:01+00:00</updated>
<author>
<name>Timm Baeder</name>
<email>tbaeder@redhat.com</email>
</author>
<published>2025-06-20T16:06:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=32fc625a3fa27fa325c75b0fc841db4ce8e06805'/>
<id>32fc625a3fa27fa325c75b0fc841db4ce8e06805</id>
<content type='text'>
…types usi… (#144676)"

This reverts commit 68471d29eed2c49f9b439e505b3f24d387d54f97.

IntegralAP contains a union:
  union {
    uint64_t *Memory = nullptr;
    uint64_t Val;
  };

On 64bit systems, both Memory and Val have the same size. However, on 32
bit system, Val is 64bit and Memory only 32bit. Which means the default
initializer for Memory will only zero half of Val. We fixed this by
zero-initializing Val explicitly in the IntegralAP(unsigned BitWidth)
constructor.


See also the discussion in
https://github.com/llvm/llvm-project/pull/144246</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
…types usi… (#144676)"

This reverts commit 68471d29eed2c49f9b439e505b3f24d387d54f97.

IntegralAP contains a union:
  union {
    uint64_t *Memory = nullptr;
    uint64_t Val;
  };

On 64bit systems, both Memory and Val have the same size. However, on 32
bit system, Val is 64bit and Memory only 32bit. Which means the default
initializer for Memory will only zero half of Val. We fixed this by
zero-initializing Val explicitly in the IntegralAP(unsigned BitWidth)
constructor.


See also the discussion in
https://github.com/llvm/llvm-project/pull/144246</pre>
</div>
</content>
</entry>
<entry>
<title>Revert "Reapply "[clang][bytecode] Allocate IntegralAP and Floating types usi… (#144676)"</title>
<updated>2025-06-18T13:17:53+00:00</updated>
<author>
<name>Timm Bäder</name>
<email>tbaeder@redhat.com</email>
</author>
<published>2025-06-18T13:17:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=68471d29eed2c49f9b439e505b3f24d387d54f97'/>
<id>68471d29eed2c49f9b439e505b3f24d387d54f97</id>
<content type='text'>
This reverts commit 7c15edb306932e41c159f3d69c161ed0d89d47b7.

This still breaks clang-armv8-quick:
https://lab.llvm.org/buildbot/#/builders/154/builds/17587
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This reverts commit 7c15edb306932e41c159f3d69c161ed0d89d47b7.

This still breaks clang-armv8-quick:
https://lab.llvm.org/buildbot/#/builders/154/builds/17587
</pre>
</div>
</content>
</entry>
<entry>
<title>Reapply "[clang][bytecode] Allocate IntegralAP and Floating types usi… (#144676)</title>
<updated>2025-06-18T12:37:29+00:00</updated>
<author>
<name>Timm Baeder</name>
<email>tbaeder@redhat.com</email>
</author>
<published>2025-06-18T12:37:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=7c15edb306932e41c159f3d69c161ed0d89d47b7'/>
<id>7c15edb306932e41c159f3d69c161ed0d89d47b7</id>
<content type='text'>
…ng an allocator (#144246)"

This reverts commit 57828fec760f086b334ce0cb1c465fc559dcaea4.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
…ng an allocator (#144246)"

This reverts commit 57828fec760f086b334ce0cb1c465fc559dcaea4.</pre>
</div>
</content>
</entry>
<entry>
<title>Revert "[clang][bytecode] Allocate IntegralAP and Floating types using an allocator (#144246)"</title>
<updated>2025-06-17T19:08:23+00:00</updated>
<author>
<name>Timm Bäder</name>
<email>tbaeder@redhat.com</email>
</author>
<published>2025-06-17T19:08:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=57828fec760f086b334ce0cb1c465fc559dcaea4'/>
<id>57828fec760f086b334ce0cb1c465fc559dcaea4</id>
<content type='text'>
This reverts commit c66be289901b3f035187d391e80e3610d7d6232e.

This breaks the armv8-quick builder:
https://lab.llvm.org/buildbot/#/builders/154/builds/17549
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This reverts commit c66be289901b3f035187d391e80e3610d7d6232e.

This breaks the armv8-quick builder:
https://lab.llvm.org/buildbot/#/builders/154/builds/17549
</pre>
</div>
</content>
</entry>
<entry>
<title>[clang][bytecode] Allocate IntegralAP and Floating types using an allocator (#144246)</title>
<updated>2025-06-17T16:31:06+00:00</updated>
<author>
<name>Timm Baeder</name>
<email>tbaeder@redhat.com</email>
</author>
<published>2025-06-17T16:31:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=c66be289901b3f035187d391e80e3610d7d6232e'/>
<id>c66be289901b3f035187d391e80e3610d7d6232e</id>
<content type='text'>
Both `APInt` and `APFloat` will heap-allocate memory themselves using
the system allocator when the size of their data exceeds 64 bits.

This is why clang has `APNumericStorage`, which allocates its memory
using an allocator (via `ASTContext`) instead. Calling `getValue()` on
an ast node like that will then create a new `APInt`/`APFloat` , which
will copy the data (in the `APFloat` case, we even copy it twice).
That's sad but whatever.

In the bytecode interpreter, we have a similar problem. Large integers
and floating-point values are placement-new allocated into the
`InterpStack` (or into the bytecode, which is a `vector&lt;std::byte&gt;`).
When we then later interrupt interpretation, we don't run the destructor
for all items on the stack, which means we leak the memory the
`APInt`/`APFloat` (which backs the `IntegralAP`/`Floating` the
interpreter uses).

Fix this by using an approach similar to the one used in the AST. Add an
allocator to `InterpState`, which is used for temporaries and local
values. Those values will be freed at the end of interpretation. For
global variables, we need to promote the values to global lifetime,
which we do via `InitGlobal` and `FinishInitGlobal` ops.

Interestingly, this results in a slight _improvement_ in compile times:
https://llvm-compile-time-tracker.com/compare.php?from=6bfcdda9b1ddf0900f82f7e30cb5e3253a791d50&amp;to=88d1d899127b408f0fb0f385c2c58e6283195049&amp;stat=instructions:u
(but don't ask me why).

Fixes https://github.com/llvm/llvm-project/issues/139012</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Both `APInt` and `APFloat` will heap-allocate memory themselves using
the system allocator when the size of their data exceeds 64 bits.

This is why clang has `APNumericStorage`, which allocates its memory
using an allocator (via `ASTContext`) instead. Calling `getValue()` on
an ast node like that will then create a new `APInt`/`APFloat` , which
will copy the data (in the `APFloat` case, we even copy it twice).
That's sad but whatever.

In the bytecode interpreter, we have a similar problem. Large integers
and floating-point values are placement-new allocated into the
`InterpStack` (or into the bytecode, which is a `vector&lt;std::byte&gt;`).
When we then later interrupt interpretation, we don't run the destructor
for all items on the stack, which means we leak the memory the
`APInt`/`APFloat` (which backs the `IntegralAP`/`Floating` the
interpreter uses).

Fix this by using an approach similar to the one used in the AST. Add an
allocator to `InterpState`, which is used for temporaries and local
values. Those values will be freed at the end of interpretation. For
global variables, we need to promote the values to global lifetime,
which we do via `InitGlobal` and `FinishInitGlobal` ops.

Interestingly, this results in a slight _improvement_ in compile times:
https://llvm-compile-time-tracker.com/compare.php?from=6bfcdda9b1ddf0900f82f7e30cb5e3253a791d50&amp;to=88d1d899127b408f0fb0f385c2c58e6283195049&amp;stat=instructions:u
(but don't ask me why).

Fixes https://github.com/llvm/llvm-project/issues/139012</pre>
</div>
</content>
</entry>
<entry>
<title>Reapply "[clang][bytecode] Fix some shift edge cases (#119895)"</title>
<updated>2024-12-16T09:01:46+00:00</updated>
<author>
<name>Timm Bäder</name>
<email>tbaeder@redhat.com</email>
</author>
<published>2024-12-14T05:28:51+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=2503a6659621e27e6b4c5946c3acff7a5b9dadca'/>
<id>2503a6659621e27e6b4c5946c3acff7a5b9dadca</id>
<content type='text'>
This reverts commit a6636ce4d124176856c3913d4bf6c3ceff1f5a1f.

This original commit failed on hosts with signed wchar_t. Care for
this in the test.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This reverts commit a6636ce4d124176856c3913d4bf6c3ceff1f5a1f.

This original commit failed on hosts with signed wchar_t. Care for
this in the test.
</pre>
</div>
</content>
</entry>
<entry>
<title>Revert "[clang][bytecode] Fix some shift edge cases (#119895)"</title>
<updated>2024-12-14T05:28:12+00:00</updated>
<author>
<name>Timm Bäder</name>
<email>tbaeder@redhat.com</email>
</author>
<published>2024-12-14T05:28:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=a6636ce4d124176856c3913d4bf6c3ceff1f5a1f'/>
<id>a6636ce4d124176856c3913d4bf6c3ceff1f5a1f</id>
<content type='text'>
This reverts commit 49c2207f21c0922aedb6c70471f8ea068977eb30.

This breaks on big-endian, again:
https://lab.llvm.org/buildbot/#/builders/154/builds/9018
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This reverts commit 49c2207f21c0922aedb6c70471f8ea068977eb30.

This breaks on big-endian, again:
https://lab.llvm.org/buildbot/#/builders/154/builds/9018
</pre>
</div>
</content>
</entry>
<entry>
<title>[clang][bytecode] Fix some shift edge cases (#119895)</title>
<updated>2024-12-14T05:15:56+00:00</updated>
<author>
<name>Timm Baeder</name>
<email>tbaeder@redhat.com</email>
</author>
<published>2024-12-14T05:15:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=49c2207f21c0922aedb6c70471f8ea068977eb30'/>
<id>49c2207f21c0922aedb6c70471f8ea068977eb30</id>
<content type='text'>
Around shifting negative values.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Around shifting negative values.</pre>
</div>
</content>
</entry>
<entry>
<title>Reapply "[clang][bytecode] Handle bitcasts involving bitfields (#116843)"</title>
<updated>2024-12-04T10:53:37+00:00</updated>
<author>
<name>Timm Bäder</name>
<email>tbaeder@redhat.com</email>
</author>
<published>2024-12-04T10:44:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=12ca72ba7f11fb880794a37cffdea5f47e3062f4'/>
<id>12ca72ba7f11fb880794a37cffdea5f47e3062f4</id>
<content type='text'>
This reverts commit 54db16221c92eb52efbea90ad5b5d2a1d00cda3e.

Check for existence of __SIZOEF_INT128__ so we don't run those
tests on targets that don't have int128.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This reverts commit 54db16221c92eb52efbea90ad5b5d2a1d00cda3e.

Check for existence of __SIZOEF_INT128__ so we don't run those
tests on targets that don't have int128.
</pre>
</div>
</content>
</entry>
</feed>
