<feed xmlns='http://www.w3.org/2005/Atom'>
<title>llvm-project.git/llvm/lib/Transforms/Vectorize/LoopVectorizationLegality.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>[LV] Consolidate shouldOptimizeForSize and remove unused BFI/PSI. NFC (#168697)</title>
<updated>2025-11-19T13:29:26+00:00</updated>
<author>
<name>Luke Lau</name>
<email>luke@igalia.com</email>
</author>
<published>2025-11-19T13:29:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=5da0445420015d859f71431a2c76f5b0cf78cbad'/>
<id>5da0445420015d859f71431a2c76f5b0cf78cbad</id>
<content type='text'>
#158690 plans on passing BFI as a lazy lambda to avoid computing
BlockFrequencyInfo when not needed.

In preparation for that, this PR removes BFI and PSI from some
constructors that aren't used. It also consolidates the two calls to
llvm::shouldOptimizeForSize so that the result is computed once and
passed where needed.

This also renames OptForSize in LoopVectorizationLegality to clarify
that it's to prevent runtime SCEV checks, see
https://reviews.llvm.org/D68082</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
#158690 plans on passing BFI as a lazy lambda to avoid computing
BlockFrequencyInfo when not needed.

In preparation for that, this PR removes BFI and PSI from some
constructors that aren't used. It also consolidates the two calls to
llvm::shouldOptimizeForSize so that the result is computed once and
passed where needed.

This also renames OptForSize in LoopVectorizationLegality to clarify
that it's to prevent runtime SCEV checks, see
https://reviews.llvm.org/D68082</pre>
</div>
</content>
</entry>
<entry>
<title>Revert "[LV] Use ExtractLane(LastActiveLane, V) live outs when tail-folding. (#149042)"</title>
<updated>2025-11-13T22:34:55+00:00</updated>
<author>
<name>Florian Hahn</name>
<email>flo@fhahn.com</email>
</author>
<published>2025-11-13T22:34:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=a6edeedbfa308876d6f2b1648729d52970bb07e6'/>
<id>a6edeedbfa308876d6f2b1648729d52970bb07e6</id>
<content type='text'>
This reverts commit 62d1a080e69e3c5e98840e000135afa7c688a77b.

This appears to be causing some runtime failures on RISCV
https://lab.llvm.org/buildbot/#/builders/210/builds/5221
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This reverts commit 62d1a080e69e3c5e98840e000135afa7c688a77b.

This appears to be causing some runtime failures on RISCV
https://lab.llvm.org/buildbot/#/builders/210/builds/5221
</pre>
</div>
</content>
</entry>
<entry>
<title>[LV] Use ExtractLane(LastActiveLane, V) live outs when tail-folding. (#149042)</title>
<updated>2025-11-12T15:11:00+00:00</updated>
<author>
<name>Florian Hahn</name>
<email>flo@fhahn.com</email>
</author>
<published>2025-11-12T15:11:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=62d1a080e69e3c5e98840e000135afa7c688a77b'/>
<id>62d1a080e69e3c5e98840e000135afa7c688a77b</id>
<content type='text'>
Building on top of https://github.com/llvm/llvm-project/pull/148817,
introduce a new abstract LastActiveLane opcode that gets lowered to
Not(Mask) → FirstActiveLane(NotMask) → Sub(result, 1).

When folding the tail, update all extracts for uses outside the loop the
extract the value of the last actice lane.

See also https://github.com/llvm/llvm-project/issues/148603

PR: https://github.com/llvm/llvm-project/pull/149042</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Building on top of https://github.com/llvm/llvm-project/pull/148817,
introduce a new abstract LastActiveLane opcode that gets lowered to
Not(Mask) → FirstActiveLane(NotMask) → Sub(result, 1).

When folding the tail, update all extracts for uses outside the loop the
extract the value of the last actice lane.

See also https://github.com/llvm/llvm-project/issues/148603

PR: https://github.com/llvm/llvm-project/pull/149042</pre>
</div>
</content>
</entry>
<entry>
<title>[LAA] Only use inbounds/nusw in isNoWrap if the GEP is dereferenced. (#161445)</title>
<updated>2025-11-04T17:08:12+00:00</updated>
<author>
<name>Florian Hahn</name>
<email>flo@fhahn.com</email>
</author>
<published>2025-11-04T17:08:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=af9a4263a1a209953a1d339ef781a954e31268ff'/>
<id>af9a4263a1a209953a1d339ef781a954e31268ff</id>
<content type='text'>
Update isNoWrap to only use the inbounds/nusw flags from GEPs that are
guaranteed to be dereferenced on every iteration. This fixes a case
where we incorrectly determine no dependence.

I think the issue is isolated to code that evaluates the resulting
AddRec at BTC, just using it to compute the distance between accesses
should still be fine; if the access does not execute in a given
iteration, there's no dependence in that iteration. But isolating the
code is not straight-forward, so be conservative for now. The practical
impact should be very minor (only one loop changed across a corpus with
27k modules from large C/C++ workloads.

Fixes https://github.com/llvm/llvm-project/issues/160912.

PR: https://github.com/llvm/llvm-project/pull/161445</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Update isNoWrap to only use the inbounds/nusw flags from GEPs that are
guaranteed to be dereferenced on every iteration. This fixes a case
where we incorrectly determine no dependence.

I think the issue is isolated to code that evaluates the resulting
AddRec at BTC, just using it to compute the distance between accesses
should still be fine; if the access does not execute in a given
iteration, there's no dependence in that iteration. But isolating the
code is not straight-forward, so be conservative for now. The practical
impact should be very minor (only one loop changed across a corpus with
27k modules from large C/C++ workloads.

Fixes https://github.com/llvm/llvm-project/issues/160912.

PR: https://github.com/llvm/llvm-project/pull/161445</pre>
</div>
</content>
</entry>
<entry>
<title>[LV] Bail out on loops with switch as latch terminator.</title>
<updated>2025-10-12T20:20:35+00:00</updated>
<author>
<name>Florian Hahn</name>
<email>flo@fhahn.com</email>
</author>
<published>2025-10-12T20:20:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=5e3ac2a6f22aa4d1d055c2d430913a960b9bb60b'/>
<id>5e3ac2a6f22aa4d1d055c2d430913a960b9bb60b</id>
<content type='text'>
Currently we cannot vectorize loops with latch blocks terminated by a
switch. In the future this could be handled by materializing appropriate
compares.

Fixes https://github.com/llvm/llvm-project/issues/156894.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Currently we cannot vectorize loops with latch blocks terminated by a
switch. In the future this could be handled by materializing appropriate
compares.

Fixes https://github.com/llvm/llvm-project/issues/156894.
</pre>
</div>
</content>
</entry>
<entry>
<title>[LV] Use StringRef::consume_front. NFC (#161454)</title>
<updated>2025-10-01T15:58:30+00:00</updated>
<author>
<name>Craig Topper</name>
<email>craig.topper@sifive.com</email>
</author>
<published>2025-10-01T15:58:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=59fe8401f473dc77825b7bdfc82dc1628ddb82cc'/>
<id>59fe8401f473dc77825b7bdfc82dc1628ddb82cc</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>[LV] Fix crash in uncountable exit with side effects checking</title>
<updated>2025-09-12T10:41:05+00:00</updated>
<author>
<name>Graham Hunter</name>
<email>graham.hunter@arm.com</email>
</author>
<published>2025-09-12T10:34:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=54fc5367f63cca8e011d93bbd55764b0a7ecbbd5'/>
<id>54fc5367f63cca8e011d93bbd55764b0a7ecbbd5</id>
<content type='text'>
Fixes an ICE reported on PR #145663, as an assert was found to be
reachable with a specific combination of unreachable blocks.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fixes an ICE reported on PR #145663, as an assert was found to be
reachable with a specific combination of unreachable blocks.
</pre>
</div>
</content>
</entry>
<entry>
<title>[LV] Enforce addrec in current loop for uncountable exit load address check</title>
<updated>2025-09-11T11:18:22+00:00</updated>
<author>
<name>Graham Hunter</name>
<email>graham.hunter@arm.com</email>
</author>
<published>2025-09-11T11:03:05+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=e285602fdab9d8c4f17c35727624446b69e038ba'/>
<id>e285602fdab9d8c4f17c35727624446b69e038ba</id>
<content type='text'>
Addresses post-commit review raised for #145663
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Addresses post-commit review raised for #145663
</pre>
</div>
</content>
</entry>
<entry>
<title>[LV] Add initial legality checks for early exit loops with side effects (#145663)</title>
<updated>2025-09-10T12:54:52+00:00</updated>
<author>
<name>Graham Hunter</name>
<email>graham.hunter@arm.com</email>
</author>
<published>2025-09-10T12:54:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=3c810b76b97456e4e1c115dcf3238a799067c466'/>
<id>3c810b76b97456e4e1c115dcf3238a799067c466</id>
<content type='text'>
This adds initial support to LoopVectorizationLegality to analyze loops
with side effects (particularly stores to memory) and an uncountable
exit. This patch alone doesn't enable any new transformations, but
does give clearer reasons for rejecting vectorization for such a loop.

The intent is for a loop like the following to pass the specific checks,
and only be rejected at the end until the transformation code is
committed:

```
// Assume a is marked restrict
// Assume b is known to be large enough to access up to b[N-1]
for (int i = 0; i &lt; N; ++) {
  a[i]++;
  if (b[i] &gt; threshold)
    break;
}
```</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This adds initial support to LoopVectorizationLegality to analyze loops
with side effects (particularly stores to memory) and an uncountable
exit. This patch alone doesn't enable any new transformations, but
does give clearer reasons for rejecting vectorization for such a loop.

The intent is for a loop like the following to pass the specific checks,
and only be rejected at the end until the transformation code is
committed:

```
// Assume a is marked restrict
// Assume b is known to be large enough to access up to b[N-1]
for (int i = 0; i &lt; N; ++) {
  a[i]++;
  if (b[i] &gt; threshold)
    break;
}
```</pre>
</div>
</content>
</entry>
<entry>
<title>[LV] Pass DT to isGuaranteedNotToBePoison in canVectorizeWithIfCvt.</title>
<updated>2025-09-05T19:42:56+00:00</updated>
<author>
<name>Florian Hahn</name>
<email>flo@fhahn.com</email>
</author>
<published>2025-09-05T19:42:18+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=b9b0ea5f621b276d767df3d197171766c5bcff0a'/>
<id>b9b0ea5f621b276d767df3d197171766c5bcff0a</id>
<content type='text'>
Pass DT to slightly improve analysis results. Note that the context
instruction is already passed.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Pass DT to slightly improve analysis results. Note that the context
instruction is already passed.
</pre>
</div>
</content>
</entry>
</feed>
