<feed xmlns='http://www.w3.org/2005/Atom'>
<title>llvm-project.git/llvm/lib/Transforms/Utils/LCSSA.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>[Utils] Avoid repeated hash lookups (NFC) (#130709)</title>
<updated>2025-03-11T14:34:14+00:00</updated>
<author>
<name>Kazu Hirata</name>
<email>kazu@google.com</email>
</author>
<published>2025-03-11T14:34:14+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=3339632e9c68ff71071b5ad72b33f7a8ac5658f6'/>
<id>3339632e9c68ff71071b5ad72b33f7a8ac5658f6</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 ArrayRef (NFC) (#102712)</title>
<updated>2024-08-10T04:39:13+00:00</updated>
<author>
<name>Kazu Hirata</name>
<email>kazu@google.com</email>
</author>
<published>2024-08-10T04:39:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=e9a47a664a67b188c553e04232f9b445890a83b2'/>
<id>e9a47a664a67b188c553e04232f9b445890a83b2</id>
<content type='text'>
Without this patch, the constructor arguments come from
SmallVectorImpl, not ArrayRef.  This patch switches them to ArrayRef
so that we can construct SmallVector with a single argument.

Note that LLVM Programmer’s Manual prefers ArrayRef to SmallVectorImpl
for flexibility.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Without this patch, the constructor arguments come from
SmallVectorImpl, not ArrayRef.  This patch switches them to ArrayRef
so that we can construct SmallVector with a single argument.

Note that LLVM Programmer’s Manual prefers ArrayRef to SmallVectorImpl
for flexibility.</pre>
</div>
</content>
</entry>
<entry>
<title>[LCSSA] Cache the loop exit blocks across recursive analysis (NFC) (#101087)</title>
<updated>2024-07-30T22:33:54+00:00</updated>
<author>
<name>Teresa Johnson</name>
<email>tejohnson@google.com</email>
</author>
<published>2024-07-30T22:33:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=273e74b4458fa0d11cafb31b5b2164a8d2006541'/>
<id>273e74b4458fa0d11cafb31b5b2164a8d2006541</id>
<content type='text'>
The computation of loop exit blocks recently showed up as a huge compile
time cost for a large file. This computation was already being cached
during an invocation of formLCSSAForInstructions, but can also be cached
across callers formLCSSA and formLCSSARecursively (the latter was what
was being invoked in the examined case).

Since each of these functions has an external entry point invoked from
other passes, doing so required refactoring each into a worker mechanism
that takes a LoopExitBlocks map, and the externally callable version
that declares the map. That way we can pass it down from the outermost
formLCSSARecursively.

This reduced the time spent in the LCSSA pass from ~110s to ~1s.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The computation of loop exit blocks recently showed up as a huge compile
time cost for a large file. This computation was already being cached
during an invocation of formLCSSAForInstructions, but can also be cached
across callers formLCSSA and formLCSSARecursively (the latter was what
was being invoked in the examined case).

Since each of these functions has an external entry point invoked from
other passes, doing so required refactoring each into a worker mechanism
that takes a LoopExitBlocks map, and the externally callable version
that declares the map. That way we can pass it down from the outermost
formLCSSARecursively.

This reduced the time spent in the LCSSA pass from ~110s to ~1s.</pre>
</div>
</content>
</entry>
<entry>
<title>[RemoveDIs][NFC] Rename DPValue -&gt; DbgVariableRecord (#85216)</title>
<updated>2024-03-19T20:07:07+00:00</updated>
<author>
<name>Stephen Tozer</name>
<email>stephen.tozer@sony.com</email>
</author>
<published>2024-03-19T20:07:07+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=ffd08c7759000f55332f1657a1fab64a7adc03fd'/>
<id>ffd08c7759000f55332f1657a1fab64a7adc03fd</id>
<content type='text'>
This is the major rename patch that prior patches have built towards.
The DPValue class is being renamed to DbgVariableRecord, which reflects
the updated terminology for the "final" implementation of the RemoveDI
feature. This is a pure string substitution + clang-format patch. The
only manual component of this patch was determining where to perform
these string substitutions: `DPValue` and `DPV` are almost exclusively
used for DbgRecords, *except* for:

- llvm/lib/target, where 'DP' is used to mean double-precision, and so
appears as part of .td files and in variable names. NB: There is a
single existing use of `DPValue` here that refers to debug info, which
I've manually updated.
- llvm/tools/gold, where 'LDPV' is used as a prefix for symbol
visibility enums.

Outside of these places, I've applied several basic string
substitutions, with the intent that they only affect DbgRecord-related
identifiers; I've checked them as I went through to verify this, with
reasonable confidence that there are no unintended changes that slipped
through the cracks. The substitutions applied are all case-sensitive,
and are applied in the order shown:

```
  DPValue -&gt; DbgVariableRecord
  DPVal -&gt; DbgVarRec
  DPV -&gt; DVR
```

Following the previous rename patches, it should be the case that there
are no instances of any of these strings that are meant to refer to the
general case of DbgRecords, or anything other than the DPValue class.
The idea behind this patch is therefore that pure string substitution is
correct in all cases as long as these assumptions hold.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This is the major rename patch that prior patches have built towards.
The DPValue class is being renamed to DbgVariableRecord, which reflects
the updated terminology for the "final" implementation of the RemoveDI
feature. This is a pure string substitution + clang-format patch. The
only manual component of this patch was determining where to perform
these string substitutions: `DPValue` and `DPV` are almost exclusively
used for DbgRecords, *except* for:

- llvm/lib/target, where 'DP' is used to mean double-precision, and so
appears as part of .td files and in variable names. NB: There is a
single existing use of `DPValue` here that refers to debug info, which
I've manually updated.
- llvm/tools/gold, where 'LDPV' is used as a prefix for symbol
visibility enums.

Outside of these places, I've applied several basic string
substitutions, with the intent that they only affect DbgRecord-related
identifiers; I've checked them as I went through to verify this, with
reasonable confidence that there are no unintended changes that slipped
through the cracks. The substitutions applied are all case-sensitive,
and are applied in the order shown:

```
  DPValue -&gt; DbgVariableRecord
  DPVal -&gt; DbgVarRec
  DPV -&gt; DVR
```

Following the previous rename patches, it should be the case that there
are no instances of any of these strings that are meant to refer to the
general case of DbgRecords, or anything other than the DPValue class.
The idea behind this patch is therefore that pure string substitution is
correct in all cases as long as these assumptions hold.</pre>
</div>
</content>
</entry>
<entry>
<title>[DebugInfo][RemoveDIs] Handle DPValues in LCSSA (#72996)</title>
<updated>2023-11-22T15:10:55+00:00</updated>
<author>
<name>Jeremy Morse</name>
<email>jeremy.morse@sony.com</email>
</author>
<published>2023-11-22T15:10:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=c1146f306d2b924449d2b60943ec6fff1efa785d'/>
<id>c1146f306d2b924449d2b60943ec6fff1efa785d</id>
<content type='text'>
LCSSA needs to manually update dbg.value intrinsic users of Values that
are having LCSSA PHIs inserted -- instrument it to do the same for
DPValues, the replacement for dbg.values.

This patch also contains an opportunistic fix replacing
instruction-insertion with iterator-insertion, necessary for
communicating debug-info in the future.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
LCSSA needs to manually update dbg.value intrinsic users of Values that
are having LCSSA PHIs inserted -- instrument it to do the same for
DPValues, the replacement for dbg.values.

This patch also contains an opportunistic fix replacing
instruction-insertion with iterator-insertion, necessary for
communicating debug-info in the future.</pre>
</div>
</content>
</entry>
<entry>
<title>[LCSSA] Compute SCEV of LCSSA phi if original instruction had SCEV</title>
<updated>2023-06-26T12:43:31+00:00</updated>
<author>
<name>Nikita Popov</name>
<email>npopov@redhat.com</email>
</author>
<published>2023-06-16T15:16:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=0e34b6a504a61d845209e58be70eaf829e59a922'/>
<id>0e34b6a504a61d845209e58be70eaf829e59a922</id>
<content type='text'>
The backstory is that the LCSSA invalidation we perform here is not
really necessary from a SCEV perspective. However, other code may
rely on the fact that invalidating only LCSSA phi nodes is sufficient
for transforms like loop peeling
(see https://reviews.llvm.org/D149331#4398582 for more details).

However, performing invalidation during LCSSA construction also
means that SCEV expansion (which may need to construct LCSSA) can
invalidate SCEV, which is somewhat unexpected and code may not be
prepared to deal with it (see the added test case, reported at
https://reviews.llvm.org/D149435#4428219).

Instead of invalidating SCEV, ensure that the LCSSA phi node also
has cached SCEV if the original instruction did. This means that
later invalidation of LCSSA phi nodes will work as expected. This
should avoid both the above issues and be more efficient.

Differential Revision: https://reviews.llvm.org/D153145
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The backstory is that the LCSSA invalidation we perform here is not
really necessary from a SCEV perspective. However, other code may
rely on the fact that invalidating only LCSSA phi nodes is sufficient
for transforms like loop peeling
(see https://reviews.llvm.org/D149331#4398582 for more details).

However, performing invalidation during LCSSA construction also
means that SCEV expansion (which may need to construct LCSSA) can
invalidate SCEV, which is somewhat unexpected and code may not be
prepared to deal with it (see the added test case, reported at
https://reviews.llvm.org/D149435#4428219).

Instead of invalidating SCEV, ensure that the LCSSA phi node also
has cached SCEV if the original instruction did. This means that
later invalidation of LCSSA phi nodes will work as expected. This
should avoid both the above issues and be more efficient.

Differential Revision: https://reviews.llvm.org/D153145
</pre>
</div>
</content>
</entry>
<entry>
<title>Revert "[LCSSA] Don't invalidate SCEV"</title>
<updated>2023-06-05T15:28:32+00:00</updated>
<author>
<name>Nikita Popov</name>
<email>npopov@redhat.com</email>
</author>
<published>2023-06-05T15:23:07+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=3c9cf023db32ba2cfa1e052ddc58f57dd080995c'/>
<id>3c9cf023db32ba2cfa1e052ddc58f57dd080995c</id>
<content type='text'>
This reverts commit 5cbb9f7a58d98ba432c6ddeefa581f6fc521315c.

Causes verifier error reported at
https://reviews.llvm.org/D149331#4387931.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This reverts commit 5cbb9f7a58d98ba432c6ddeefa581f6fc521315c.

Causes verifier error reported at
https://reviews.llvm.org/D149331#4387931.
</pre>
</div>
</content>
</entry>
<entry>
<title>Revert "[LCSSA] Remove unused ScalarEvolution argument (NFC)"</title>
<updated>2023-06-05T14:45:38+00:00</updated>
<author>
<name>Nikita Popov</name>
<email>npopov@redhat.com</email>
</author>
<published>2023-06-05T14:41:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=143ed21b26b2c68695e9f74f0ce4632b8a2e000b'/>
<id>143ed21b26b2c68695e9f74f0ce4632b8a2e000b</id>
<content type='text'>
This reverts commit 5362a0d859d8e96b3f7c0437b7866e17a818a4f7.

In preparation for reverting a dependent revision.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This reverts commit 5362a0d859d8e96b3f7c0437b7866e17a818a4f7.

In preparation for reverting a dependent revision.
</pre>
</div>
</content>
</entry>
<entry>
<title>[SCEVExpander] Remember phi nodes inserted by LCSSA construction</title>
<updated>2023-05-25T07:34:19+00:00</updated>
<author>
<name>Nikita Popov</name>
<email>npopov@redhat.com</email>
</author>
<published>2023-05-16T15:05:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=d5c56c5162e535baec61e385f53e512adeaa2815'/>
<id>d5c56c5162e535baec61e385f53e512adeaa2815</id>
<content type='text'>
SCEVExpander keeps track of all instructions it inserted. However,
it currently misses some phi nodes created during LCSSA construction.
Fix this by collecting these into another argument.

This also removes the IRBuilder argument, which was added for
essentially the same purpose, but only handles the root LCSSA nodes,
not those inserted by SSAUpdater.

This was reported as a regression on D149344, but the reduced test
case also reproduces without it.

Differential Revision: https://reviews.llvm.org/D150681
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
SCEVExpander keeps track of all instructions it inserted. However,
it currently misses some phi nodes created during LCSSA construction.
Fix this by collecting these into another argument.

This also removes the IRBuilder argument, which was added for
essentially the same purpose, but only handles the root LCSSA nodes,
not those inserted by SSAUpdater.

This was reported as a regression on D149344, but the reduced test
case also reproduces without it.

Differential Revision: https://reviews.llvm.org/D150681
</pre>
</div>
</content>
</entry>
<entry>
<title>[LCSSA] Remove unused ScalarEvolution argument (NFC)</title>
<updated>2023-05-02T10:17:05+00:00</updated>
<author>
<name>Nikita Popov</name>
<email>npopov@redhat.com</email>
</author>
<published>2023-05-02T10:13:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=5362a0d859d8e96b3f7c0437b7866e17a818a4f7'/>
<id>5362a0d859d8e96b3f7c0437b7866e17a818a4f7</id>
<content type='text'>
After D149435, LCSSA formation no longer needs access to
ScalarEvolution, so remove the argument from the utilities.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
After D149435, LCSSA formation no longer needs access to
ScalarEvolution, so remove the argument from the utilities.
</pre>
</div>
</content>
</entry>
</feed>
