<feed xmlns='http://www.w3.org/2005/Atom'>
<title>llvm-project.git/llvm/lib/Transforms/Utils/VNCoercion.cpp, branch users/nico/python-2</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>[GVN] Load-store forwaring of scalable store to fixed load. (#124748)</title>
<updated>2025-01-30T10:49:42+00:00</updated>
<author>
<name>Lou</name>
<email>lou.knauer@sipearl.com</email>
</author>
<published>2025-01-30T10:49:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=c75b251103a6acd785e6f43f640d7a08bd259c41'/>
<id>c75b251103a6acd785e6f43f640d7a08bd259c41</id>
<content type='text'>
When storing a scalable vector and loading a fixed-size vector, where
the
scalable vector is known to be larger based on vscale_range, perform
store-to-load forwarding through temporary @llvm.vector.extract calls.
InstCombine then folds the insert/extract pair away.

The usecase is shown in https://godbolt.org/z/KT3sMrMbd, which shows
that clang generates IR that matches this pattern when the
"arm_sve_vector_bits" attribute is used:

```c
typedef svfloat32_t svfloat32_fixed_t
__attribute__((arm_sve_vector_bits(512)));

struct svfloat32_wrapped_t {
  svfloat32_fixed_t v;
};

static inline svfloat32_wrapped_t
add(svfloat32_wrapped_t a, svfloat32_wrapped_t b) {
  return {svadd_f32_x(svptrue_b32(), a.v, b.v)};
}

svfloat32_wrapped_t
foo(svfloat32_wrapped_t a, svfloat32_wrapped_t b) {
  // The IR pattern this patch matches is generated for this return:
  return add(a, b);
}
```</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When storing a scalable vector and loading a fixed-size vector, where
the
scalable vector is known to be larger based on vscale_range, perform
store-to-load forwarding through temporary @llvm.vector.extract calls.
InstCombine then folds the insert/extract pair away.

The usecase is shown in https://godbolt.org/z/KT3sMrMbd, which shows
that clang generates IR that matches this pattern when the
"arm_sve_vector_bits" attribute is used:

```c
typedef svfloat32_t svfloat32_fixed_t
__attribute__((arm_sve_vector_bits(512)));

struct svfloat32_wrapped_t {
  svfloat32_fixed_t v;
};

static inline svfloat32_wrapped_t
add(svfloat32_wrapped_t a, svfloat32_wrapped_t b) {
  return {svadd_f32_x(svptrue_b32(), a.v, b.v)};
}

svfloat32_wrapped_t
foo(svfloat32_wrapped_t a, svfloat32_wrapped_t b) {
  // The IR pattern this patch matches is generated for this return:
  return add(a, b);
}
```</pre>
</div>
</content>
</entry>
<entry>
<title>[GVN] Handle scalable vectors with the same size in VNCoercion (#123984)</title>
<updated>2025-01-23T18:43:50+00:00</updated>
<author>
<name>David Green</name>
<email>david.green@arm.com</email>
</author>
<published>2025-01-23T18:43:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=775d0f36f74851172f84074d90cde29e181b3edd'/>
<id>775d0f36f74851172f84074d90cde29e181b3edd</id>
<content type='text'>
This allows us to forward to a load even if the types do not match
(nxv4i32 vs nxv2i64 for example). Scalable types are allowed in
canCoerceMustAliasedValueToLoad so long as the size (minelts *
scalarsize) is the same, and some follow-on code is adjusted to make
sure it handles scalable sizes correctly. Methods like
analyzeLoadFromClobberingWrite and analyzeLoadFromClobberingStore still
do nothing for scalable vectors, as Offsets and mismatching types are
not supported.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This allows us to forward to a load even if the types do not match
(nxv4i32 vs nxv2i64 for example). Scalable types are allowed in
canCoerceMustAliasedValueToLoad so long as the size (minelts *
scalarsize) is the same, and some follow-on code is adjusted to make
sure it handles scalable sizes correctly. Methods like
analyzeLoadFromClobberingWrite and analyzeLoadFromClobberingStore still
do nothing for scalable vectors, as Offsets and mismatching types are
not supported.</pre>
</div>
</content>
</entry>
<entry>
<title>[Utils] Remove unused includes (NFC) (#114748)</title>
<updated>2024-11-05T03:51:25+00:00</updated>
<author>
<name>Kazu Hirata</name>
<email>kazu@google.com</email>
</author>
<published>2024-11-05T03:51:25+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=013f4a46d1978e370f940df3cbd04fb0399a04fe'/>
<id>013f4a46d1978e370f940df3cbd04fb0399a04fe</id>
<content type='text'>
Identified with misc-include-cleaner.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Identified with misc-include-cleaner.</pre>
</div>
</content>
</entry>
<entry>
<title>[VNCoercion] Drop some redundant functions (NFC)</title>
<updated>2023-04-12T14:46:54+00:00</updated>
<author>
<name>Nikita Popov</name>
<email>npopov@redhat.com</email>
</author>
<published>2023-04-12T14:39:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=ae28e016d3c4dd7c1deb63a8499964eb2de7129e'/>
<id>ae28e016d3c4dd7c1deb63a8499964eb2de7129e</id>
<content type='text'>
These load and store APIs now do the same thing, so combine them
into one.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
These load and store APIs now do the same thing, so combine them
into one.
</pre>
</div>
</content>
</entry>
<entry>
<title>[GVN][VNCoercion] Remove load widening leftovers (NFCI)</title>
<updated>2023-04-12T14:32:46+00:00</updated>
<author>
<name>Nikita Popov</name>
<email>npopov@redhat.com</email>
</author>
<published>2023-04-12T14:29:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=6e78fd58cd06e84a4358ef189543e080d2b913aa'/>
<id>6e78fd58cd06e84a4358ef189543e080d2b913aa</id>
<content type='text'>
GVN load widening was disabled in D24096. This removes various
support code that is no longer relevant.

The way this works nowadays is that we return PartialAlias with
an offset from BasicAA and this gets passed on as a clobber by
MDA. However, PartialAlias will only be returned if the load is
properly nested inside the other load.

This just removes the bulk of the code, but some additional
cleanup can be done here now that we don't need to distinguish
between load and store cases.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
GVN load widening was disabled in D24096. This removes various
support code that is no longer relevant.

The way this works nowadays is that we return PartialAlias with
an offset from BasicAA and this gets passed on as a clobber by
MDA. However, PartialAlias will only be returned if the load is
properly nested inside the other load.

This just removes the bulk of the code, but some additional
cleanup can be done here now that we don't need to distinguish
between load and store cases.
</pre>
</div>
</content>
</entry>
<entry>
<title>Use llvm::bit_ceil (NFC)</title>
<updated>2023-01-29T00:13:09+00:00</updated>
<author>
<name>Kazu Hirata</name>
<email>kazu@google.com</email>
</author>
<published>2023-01-29T00:13:09+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=526966d07dc89ad69940259020d97d25f26b1306'/>
<id>526966d07dc89ad69940259020d97d25f26b1306</id>
<content type='text'>
Note that:

  std::has_single_bit(X) ? X : llvm::NextPowerOf2(X);

is equivalent to:

  std::bit_ceil(X)

even for input 0.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Note that:

  std::has_single_bit(X) ? X : llvm::NextPowerOf2(X);

is equivalent to:

  std::bit_ceil(X)

even for input 0.
</pre>
</div>
</content>
</entry>
<entry>
<title>[NFC] Use TypeSize::geFixedValue() instead of TypeSize::getFixedSize()</title>
<updated>2023-01-11T16:49:38+00:00</updated>
<author>
<name>Guillaume Chatelet</name>
<email>gchatelet@google.com</email>
</author>
<published>2023-01-11T16:48:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=8fd5558b29761aec91143129cb23c90581a944e9'/>
<id>8fd5558b29761aec91143129cb23c90581a944e9</id>
<content type='text'>
This change is one of a series to implement the discussion from
https://reviews.llvm.org/D141134.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This change is one of a series to implement the discussion from
https://reviews.llvm.org/D141134.
</pre>
</div>
</content>
</entry>
<entry>
<title>[IR] Add a target extension type to LLVM.</title>
<updated>2022-12-20T16:02:11+00:00</updated>
<author>
<name>Joshua Cranmer</name>
<email>joshua.cranmer@intel.com</email>
</author>
<published>2022-12-20T16:02:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=e6b02214c68df2c9f826e02310c9352ac652e456'/>
<id>e6b02214c68df2c9f826e02310c9352ac652e456</id>
<content type='text'>
Target-extension types represent types that need to be preserved through
optimization, but otherwise are not introspectable by target-independent
optimizations. This patch doesn't add any uses of these types by an existing
backend, it only provides basic infrastructure such that these types would work
correctly.

Reviewed By: nikic, barannikov88

Differential Revision: https://reviews.llvm.org/D135202
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Target-extension types represent types that need to be preserved through
optimization, but otherwise are not introspectable by target-independent
optimizations. This patch doesn't add any uses of these types by an existing
backend, it only provides basic infrastructure such that these types would work
correctly.

Reviewed By: nikic, barannikov88

Differential Revision: https://reviews.llvm.org/D135202
</pre>
</div>
</content>
</entry>
<entry>
<title>Take memset_inline into account in analyzeLoadFromClobberingMemInst</title>
<updated>2022-10-26T09:50:13+00:00</updated>
<author>
<name>Guillaume Chatelet</name>
<email>gchatelet@google.com</email>
</author>
<published>2022-10-26T09:34:34+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=1a726cfa83667585dd87a9955ed5e331cad45d18'/>
<id>1a726cfa83667585dd87a9955ed5e331cad45d18</id>
<content type='text'>
This appeared in https://reviews.llvm.org/D126903#3884061

Differential Revision: https://reviews.llvm.org/D136752
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This appeared in https://reviews.llvm.org/D126903#3884061

Differential Revision: https://reviews.llvm.org/D136752
</pre>
</div>
</content>
</entry>
<entry>
<title>[VNCoercion] Separate constant/non-constant mem intrinsic implementations (NFCI)</title>
<updated>2022-06-30T13:26:06+00:00</updated>
<author>
<name>Nikita Popov</name>
<email>npopov@redhat.com</email>
</author>
<published>2022-06-30T13:19:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=588e229bf92765263534ddc06b3241c936f52bfd'/>
<id>588e229bf92765263534ddc06b3241c936f52bfd</id>
<content type='text'>
This means we no longer need to have the same API between IRBuilder
and IRBuilderFolder.

The constant case is substantially simpler, so implementing it
separately isn't an undue burden.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This means we no longer need to have the same API between IRBuilder
and IRBuilderFolder.

The constant case is substantially simpler, so implementing it
separately isn't an undue burden.
</pre>
</div>
</content>
</entry>
</feed>
