<feed xmlns='http://www.w3.org/2005/Atom'>
<title>llvm-project.git/llvm/lib/Transforms/Scalar/IndVarSimplify.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>Revert "[LICM] Sink unused l-invariant loads in preheader. #157559"</title>
<updated>2025-11-14T13:51:33+00:00</updated>
<author>
<name>Alexander Belyaev</name>
<email>pifon@google.com</email>
</author>
<published>2025-11-14T13:19:51+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=7ee0e0f956ac2c9e601132a9efbb163f5a81893f'/>
<id>7ee0e0f956ac2c9e601132a9efbb163f5a81893f</id>
<content type='text'>
This reverts commit 469702c5d5cc4fa18c3a962afb971950a084f373.

https://github.com/llvm/llvm-project/issues/168048
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This reverts commit 469702c5d5cc4fa18c3a962afb971950a084f373.

https://github.com/llvm/llvm-project/issues/168048
</pre>
</div>
</content>
</entry>
<entry>
<title>[IndVarSimplify] Ensure fp values can be represented as exact integers</title>
<updated>2025-11-11T09:30:58+00:00</updated>
<author>
<name>Antonio Frighetto</name>
<email>me@antoniofrighetto.com</email>
</author>
<published>2025-11-11T09:28:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=eaf3a91722fbb0f6598907c9dfa14ca632cc71c4'/>
<id>eaf3a91722fbb0f6598907c9dfa14ca632cc71c4</id>
<content type='text'>
When transforming floating-point induction variables into integer ones,
make sure we stay within the bounds of fp values that can be represented
as integers without gaps, i.e., 2^24 and 2^53 for IEEE-754 single and
double precision respectively (both on negative and positive side).

Fixes: https://github.com/llvm/llvm-project/issues/166496.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When transforming floating-point induction variables into integer ones,
make sure we stay within the bounds of fp values that can be represented
as integers without gaps, i.e., 2^24 and 2^53 for IEEE-754 single and
double precision respectively (both on negative and positive side).

Fixes: https://github.com/llvm/llvm-project/issues/166496.
</pre>
</div>
</content>
</entry>
<entry>
<title>[LICM] Sink unused l-invariant loads in preheader. (#157559)</title>
<updated>2025-10-30T14:23:04+00:00</updated>
<author>
<name>Vigneshwar Jayakumar</name>
<email>vigneshwar.jayakumar@amd.com</email>
</author>
<published>2025-10-30T14:23:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=469702c5d5cc4fa18c3a962afb971950a084f373'/>
<id>469702c5d5cc4fa18c3a962afb971950a084f373</id>
<content type='text'>
Unused loop invariant loads were not sunk from the preheader to the exit
block, increasing live range.

This commit moves the sinkUnusedInvariant logic from indvarsimplify to
LICM also adds functionality to sink unused load that's not
clobbered by the loop body.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Unused loop invariant loads were not sunk from the preheader to the exit
block, increasing live range.

This commit moves the sinkUnusedInvariant logic from indvarsimplify to
LICM also adds functionality to sink unused load that's not
clobbered by the loop body.</pre>
</div>
</content>
</entry>
<entry>
<title>[IndVarSimplify] Allow predicateLoopExit on some loops with thread-local writes (#155901)</title>
<updated>2025-10-16T16:18:00+00:00</updated>
<author>
<name>Florian Mayer</name>
<email>fmayer@google.com</email>
</author>
<published>2025-10-16T16:18:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=39b0cbe69ca8704dbc5846a91d136f0ed6101782'/>
<id>39b0cbe69ca8704dbc5846a91d136f0ed6101782</id>
<content type='text'>
This is important to optimize patterns that frequently appear with
bounds checks:

```
for (int i = 0; i &lt; N; ++i) {
  bar[i] = foo[i] + 123;
}
```

which gets roughly turned into

```
for (int i = 0; i &lt; N; ++i) {
  if (i &gt;= size of foo)
     ubsan.trap();
  if (i &gt;= size of bar)
     ubsan.trap();
  bar[i] = foo[i] + 123;
}
```

Motivating example:
https://github.com/google/boringssl/blob/main/crypto/fipsmodule/hmac/hmac.cc.inc#L138

I hand-verified the assembly and confirmed that this optimization
removes the check in the loop.
This also allowed the loop to be vectorized.

Alive2: https://alive2.llvm.org/ce/z/3qMdLF

I did a `stage2-check-all` for both normal and
`-DBOOTSTRAP_CMAKE_C[XX]_FLAGS="-fsanitize=array-bounds
-fsanitize-trap=all"`.

I also ran some Google-internal tests with `fsanitize=array-bounds`.
Everything passes.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This is important to optimize patterns that frequently appear with
bounds checks:

```
for (int i = 0; i &lt; N; ++i) {
  bar[i] = foo[i] + 123;
}
```

which gets roughly turned into

```
for (int i = 0; i &lt; N; ++i) {
  if (i &gt;= size of foo)
     ubsan.trap();
  if (i &gt;= size of bar)
     ubsan.trap();
  bar[i] = foo[i] + 123;
}
```

Motivating example:
https://github.com/google/boringssl/blob/main/crypto/fipsmodule/hmac/hmac.cc.inc#L138

I hand-verified the assembly and confirmed that this optimization
removes the check in the loop.
This also allowed the loop to be vectorized.

Alive2: https://alive2.llvm.org/ce/z/3qMdLF

I did a `stage2-check-all` for both normal and
`-DBOOTSTRAP_CMAKE_C[XX]_FLAGS="-fsanitize=array-bounds
-fsanitize-trap=all"`.

I also ran some Google-internal tests with `fsanitize=array-bounds`.
Everything passes.</pre>
</div>
</content>
</entry>
<entry>
<title>[llvm] Remove unused includes of SmallSet.h (NFC) (#154893)</title>
<updated>2025-08-22T17:33:46+00:00</updated>
<author>
<name>Kazu Hirata</name>
<email>kazu@google.com</email>
</author>
<published>2025-08-22T17:33:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=11b4f110e0f9f1a0f987faa121c594af1bcd43cc'/>
<id>11b4f110e0f9f1a0f987faa121c594af1bcd43cc</id>
<content type='text'>
We just replaced SmallSet&lt;T *, N&gt; with SmallPtrSet&lt;T *, N&gt;, bypassing
the redirection found in SmallSet.h.  With that, we no longer need to
include SmallSet.h in many files.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
We just replaced SmallSet&lt;T *, N&gt; with SmallPtrSet&lt;T *, N&gt;, bypassing
the redirection found in SmallSet.h.  With that, we no longer need to
include SmallSet.h in many files.</pre>
</div>
</content>
</entry>
<entry>
<title>[llvm] Replace SmallSet with SmallPtrSet (NFC) (#154068)</title>
<updated>2025-08-18T14:01:29+00:00</updated>
<author>
<name>Kazu Hirata</name>
<email>kazu@google.com</email>
</author>
<published>2025-08-18T14:01:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=07eb7b76928d6873c60859a0339591ed9e0f512a'/>
<id>07eb7b76928d6873c60859a0339591ed9e0f512a</id>
<content type='text'>
This patch replaces SmallSet&lt;T *, N&gt; with SmallPtrSet&lt;T *, N&gt;.  Note
that SmallSet.h "redirects" SmallSet to SmallPtrSet for pointer
element types:

  template &lt;typename PointeeType, unsigned N&gt;
class SmallSet&lt;PointeeType*, N&gt; : public SmallPtrSet&lt;PointeeType*, N&gt;
{};

We only have 140 instances that rely on this "redirection", with the
vast majority of them under llvm/. Since relying on the redirection
doesn't improve readability, this patch replaces SmallSet with
SmallPtrSet for pointer element types.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This patch replaces SmallSet&lt;T *, N&gt; with SmallPtrSet&lt;T *, N&gt;.  Note
that SmallSet.h "redirects" SmallSet to SmallPtrSet for pointer
element types:

  template &lt;typename PointeeType, unsigned N&gt;
class SmallSet&lt;PointeeType*, N&gt; : public SmallPtrSet&lt;PointeeType*, N&gt;
{};

We only have 140 instances that rely on this "redirection", with the
vast majority of them under llvm/. Since relying on the redirection
doesn't improve readability, this patch replaces SmallSet with
SmallPtrSet for pointer element types.</pre>
</div>
</content>
</entry>
<entry>
<title>[DLCov][NFC] Annotate intentionally-blank DebugLocs in existing code (#136192)</title>
<updated>2025-06-11T16:42:10+00:00</updated>
<author>
<name>Stephen Tozer</name>
<email>stephen.tozer@sony.com</email>
</author>
<published>2025-06-11T16:42:10+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=aa8a1fa6f515f45db55365b9c1f8453ded24ed32'/>
<id>aa8a1fa6f515f45db55365b9c1f8453ded24ed32</id>
<content type='text'>
Following the work in PR #107279, this patch applies the annotative
DebugLocs, which indicate that a particular instruction is intentionally
missing a location for a given reason, to existing sites in the compiler
where their conditions apply. This is NFC in ordinary LLVM builds (each
function `DebugLoc::getFoo()` is inlined as `DebugLoc()`), but marks the
instruction in coverage-tracking builds so that it will be ignored by
Debugify, allowing only real errors to be reported. From a developer
standpoint, it also communicates the intentionality and reason for a
missing DebugLoc.

Some notes for reviewers:

- The difference between `I-&gt;dropLocation()` and
`I-&gt;setDebugLoc(DebugLoc::getDropped())` is that the former _may_ decide
to keep some debug info alive, while the latter will always be empty; in
this patch, I always used the latter (even if the former could
technically be correct), because the former could result in some
(barely) different output, and I'd prefer to keep this patch purely NFC.
- I've generally documented the uses of `DebugLoc::getUnknown()`, with
the exception of the vectorizers - in summary, they are a huge cause of
dropped source locations, and I don't have the time or the domain
knowledge currently to solve that, so I've plastered it all over them as
a form of "fixme".</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Following the work in PR #107279, this patch applies the annotative
DebugLocs, which indicate that a particular instruction is intentionally
missing a location for a given reason, to existing sites in the compiler
where their conditions apply. This is NFC in ordinary LLVM builds (each
function `DebugLoc::getFoo()` is inlined as `DebugLoc()`), but marks the
instruction in coverage-tracking builds so that it will be ignored by
Debugify, allowing only real errors to be reported. From a developer
standpoint, it also communicates the intentionality and reason for a
missing DebugLoc.

Some notes for reviewers:

- The difference between `I-&gt;dropLocation()` and
`I-&gt;setDebugLoc(DebugLoc::getDropped())` is that the former _may_ decide
to keep some debug info alive, while the latter will always be empty; in
this patch, I always used the latter (even if the former could
technically be correct), because the former could result in some
(barely) different output, and I'd prefer to keep this patch purely NFC.
- I've generally documented the uses of `DebugLoc::getUnknown()`, with
the exception of the vectorizers - in summary, they are a huge cause of
dropped source locations, and I don't have the time or the domain
knowledge currently to solve that, so I've plastered it all over them as
a form of "fixme".</pre>
</div>
</content>
</entry>
<entry>
<title>[SCEV] Add dedicated AffineAddRec matcher + loop matchers (NFC). (#141141)</title>
<updated>2025-05-25T07:40:31+00:00</updated>
<author>
<name>Florian Hahn</name>
<email>flo@fhahn.com</email>
</author>
<published>2025-05-25T07:40:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=bc0c4db5d95f229b420f3df0c01d0e41cff157c5'/>
<id>bc0c4db5d95f229b420f3df0c01d0e41cff157c5</id>
<content type='text'>
Add dedicated m_scev_AffineAddRec matcher with 
complementing m_Loop() and m_SpecificLoop matchers.

PR: https://github.com/llvm/llvm-project/pull/141141</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Add dedicated m_scev_AffineAddRec matcher with 
complementing m_Loop() and m_SpecificLoop matchers.

PR: https://github.com/llvm/llvm-project/pull/141141</pre>
</div>
</content>
</entry>
<entry>
<title>[IndVars] Improve code; use SCEVPatternMatch (NFC) (#139533)</title>
<updated>2025-05-22T18:17:22+00:00</updated>
<author>
<name>Ramkumar Ramachandra</name>
<email>ramkumar.ramachandra@codasip.com</email>
</author>
<published>2025-05-22T18:17:22+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=f07fc38a4ce306bce59371f36957f516b6d4e614'/>
<id>f07fc38a4ce306bce59371f36957f516b6d4e614</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>[llvm] Construct SmallVector with iterator ranges (NFC) (#136460)</title>
<updated>2025-04-20T02:07:10+00:00</updated>
<author>
<name>Kazu Hirata</name>
<email>kazu@google.com</email>
</author>
<published>2025-04-20T02:07:10+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=e9487fed29f386bd67e468b6c7a9c86684a6247d'/>
<id>e9487fed29f386bd67e468b6c7a9c86684a6247d</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
</feed>
