<feed xmlns='http://www.w3.org/2005/Atom'>
<title>llvm-project.git/llvm/lib/Transforms/Utils/MoveAutoInit.cpp, branch users/nico/python-1</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>[NFC][DebugInfo] Use iterator-flavour getFirstNonPHI at many call-sites (#123737)</title>
<updated>2025-01-24T13:27:56+00:00</updated>
<author>
<name>Jeremy Morse</name>
<email>jeremy.morse@sony.com</email>
</author>
<published>2025-01-24T13:27:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=6292a808b3524d9ba6f4ce55bc5b9e547b088dd8'/>
<id>6292a808b3524d9ba6f4ce55bc5b9e547b088dd8</id>
<content type='text'>
As part of the "RemoveDIs" project, BasicBlock::iterator now carries a
debug-info bit that's needed when getFirstNonPHI and similar feed into
instruction insertion positions. Call-sites where that's necessary were
updated a year ago; but to ensure some type safety however, we'd like to
have all calls to getFirstNonPHI use the iterator-returning version.

This patch changes a bunch of call-sites calling getFirstNonPHI to use
getFirstNonPHIIt, which returns an iterator. All these call sites are
where it's obviously safe to fetch the iterator then dereference it. A
follow-up patch will contain less-obviously-safe changes.

We'll eventually deprecate and remove the instruction-pointer
getFirstNonPHI, but not before adding concise documentation of what
considerations are needed (very few).

---------

Co-authored-by: Stephen Tozer &lt;Melamoto@gmail.com&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
As part of the "RemoveDIs" project, BasicBlock::iterator now carries a
debug-info bit that's needed when getFirstNonPHI and similar feed into
instruction insertion positions. Call-sites where that's necessary were
updated a year ago; but to ensure some type safety however, we'd like to
have all calls to getFirstNonPHI use the iterator-returning version.

This patch changes a bunch of call-sites calling getFirstNonPHI to use
getFirstNonPHIIt, which returns an iterator. All these call sites are
where it's obviously safe to fetch the iterator then dereference it. A
follow-up patch will contain less-obviously-safe changes.

We'll eventually deprecate and remove the instruction-pointer
getFirstNonPHI, but not before adding concise documentation of what
considerations are needed (very few).

---------

Co-authored-by: Stephen Tozer &lt;Melamoto@gmail.com&gt;</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>[MoveAutoInit] Ignore unreachable basicblocks and handle catchswitch (#78232)</title>
<updated>2024-01-16T10:45:44+00:00</updated>
<author>
<name>XChy</name>
<email>xxs_chy@outlook.com</email>
</author>
<published>2024-01-16T10:45:44+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=26d3cd1d07ae3fc8312feb2ab3a3a86414f28c70'/>
<id>26d3cd1d07ae3fc8312feb2ab3a3a86414f28c70</id>
<content type='text'>
Fixes #78049
This patch has done:
- Ignore unreachable predecessors when looking for nearest common
dominator.
- Check catchswitch with `getFirstNonPHI`, instead of
`getFirstInsertionPt`. The latter skips EHPad.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fixes #78049
This patch has done:
- Ignore unreachable predecessors when looking for nearest common
dominator.
- Check catchswitch with `getFirstNonPHI`, instead of
`getFirstInsertionPt`. The latter skips EHPad.</pre>
</div>
</content>
</entry>
<entry>
<title>[llvm] Stop including llvm/ADT/StringSet.h (NFC)</title>
<updated>2023-12-01T07:45:12+00:00</updated>
<author>
<name>Kazu Hirata</name>
<email>kazu@google.com</email>
</author>
<published>2023-12-01T07:45:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=520c3b82db7199c1dcd24520f3c0ac573c191791'/>
<id>520c3b82db7199c1dcd24520f3c0ac573c191791</id>
<content type='text'>
Identified with clangd.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Identified with clangd.
</pre>
</div>
</content>
</entry>
<entry>
<title>[NFC][RemoveDIs] Prefer iterator-insertion over instructions</title>
<updated>2023-09-11T10:48:45+00:00</updated>
<author>
<name>Jeremy Morse</name>
<email>jeremy.morse@sony.com</email>
</author>
<published>2023-09-11T10:32:51+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=6942c64e8128e4ccd891b813d0240f574f80f59e'/>
<id>6942c64e8128e4ccd891b813d0240f574f80f59e</id>
<content type='text'>
Continuing the patch series to get rid of debug intrinsics [0], instruction
insertion needs to be done with iterators rather than instruction pointers,
so that we can communicate information in the iterator class. This patch
adds an iterator-taking insertBefore method and converts various call sites
to take iterators. These are all sites where such debug-info needs to be
preserved so that a stage2 clang can be built identically; it's likely that
many more will need to be changed in the future.

At this stage, this is just changing the spelling of a few operations,
which will eventually become signifiant once the debug-info bearing
iterator is used.

[0] https://discourse.llvm.org/t/rfc-instruction-api-changes-needed-to-eliminate-debug-intrinsics-from-ir/68939

Differential Revision: https://reviews.llvm.org/D152537
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Continuing the patch series to get rid of debug intrinsics [0], instruction
insertion needs to be done with iterators rather than instruction pointers,
so that we can communicate information in the iterator class. This patch
adds an iterator-taking insertBefore method and converts various call sites
to take iterators. These are all sites where such debug-info needs to be
preserved so that a stage2 clang can be built identically; it's likely that
many more will need to be changed in the future.

At this stage, this is just changing the spelling of a few operations,
which will eventually become signifiant once the debug-info bearing
iterator is used.

[0] https://discourse.llvm.org/t/rfc-instruction-api-changes-needed-to-eliminate-debug-intrinsics-from-ir/68939

Differential Revision: https://reviews.llvm.org/D152537
</pre>
</div>
</content>
</entry>
<entry>
<title>[MoveAutoInit] Gracefully handle auto-init annotation on unexpected instr (PR64661)</title>
<updated>2023-08-15T14:21:25+00:00</updated>
<author>
<name>Nikita Popov</name>
<email>npopov@redhat.com</email>
</author>
<published>2023-08-15T14:21:25+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=fb0c50be5b66ca689d78ad281cb07bf46d435756'/>
<id>fb0c50be5b66ca689d78ad281cb07bf46d435756</id>
<content type='text'>
Abort the transform instead of asserting.

Fixes https://github.com/llvm/llvm-project/issues/64661.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Abort the transform instead of asserting.

Fixes https://github.com/llvm/llvm-project/issues/64661.
</pre>
</div>
</content>
</entry>
<entry>
<title>change checking for auto-init metadata to use `equalsStr` instead of casing MDOperand nodes.</title>
<updated>2023-06-08T14:58:01+00:00</updated>
<author>
<name>Zain Jaffal</name>
<email>z_jaffal@apple.com</email>
</author>
<published>2023-06-08T14:57:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=d65c0527ab70b8089492b6788c0e2ea0cfa219e6'/>
<id>d65c0527ab70b8089492b6788c0e2ea0cfa219e6</id>
<content type='text'>
Since `MD_annotation` metadata now supports having mutliple strings in the annotation node. casing Operand to string directly will cause a crash. When checking if `MDOperand` equals str you can use `equalsStr` method.

Reviewed By: serge-sans-paille

Differential Revision: https://reviews.llvm.org/D152372
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Since `MD_annotation` metadata now supports having mutliple strings in the annotation node. casing Operand to string directly will cause a crash. When checking if `MDOperand` equals str you can use `equalsStr` method.

Reviewed By: serge-sans-paille

Differential Revision: https://reviews.llvm.org/D152372
</pre>
</div>
</content>
</entry>
<entry>
<title>Reapply Move "auto-init" instructions to the dominator of their users</title>
<updated>2023-04-24T16:10:10+00:00</updated>
<author>
<name>serge-sans-paille</name>
<email>sguelton@mozilla.com</email>
</author>
<published>2023-04-17T08:13:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=afa13ba18d9e0eb0de4cccb7061222fe900b732f'/>
<id>afa13ba18d9e0eb0de4cccb7061222fe900b732f</id>
<content type='text'>
Original patch (50b2a113db197a97f60ad2aace8b7382dc9b8c31) ignored the
fact that -ftrivial-auto-var-init could affect function parameters with
the sret attribute.
Just do not move instruction that don't affect alloca.
Also add missing test case for volatile instruction.

Differential Revision: https://reviews.llvm.org/D148507
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Original patch (50b2a113db197a97f60ad2aace8b7382dc9b8c31) ignored the
fact that -ftrivial-auto-var-init could affect function parameters with
the sret attribute.
Just do not move instruction that don't affect alloca.
Also add missing test case for volatile instruction.

Differential Revision: https://reviews.llvm.org/D148507
</pre>
</div>
</content>
</entry>
<entry>
<title>Revert "Move "auto-init" instructions to the dominator of their users"</title>
<updated>2023-04-12T11:37:21+00:00</updated>
<author>
<name>Hans Wennborg</name>
<email>hans@chromium.org</email>
</author>
<published>2023-04-12T11:28:25+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=a6d9730f403afa8b591f278101996ecca9ad2dd2'/>
<id>a6d9730f403afa8b591f278101996ecca9ad2dd2</id>
<content type='text'>
This could also move initialization of sret args, causing actually
initialized parts of such return values to be uninitialized. See
discussion on the code review.

&gt; As a result of -ftrivial-auto-var-init, clang generates instructions to
&gt; set alloca'd memory to a given pattern, right after the allocation site.
&gt; In some cases, this (somehow costly) operation could be delayed, leading
&gt; to conditional execution in some cases.
&gt;
&gt; This is not an uncommon situation: it happens ~500 times on the cPython
&gt; code base, and much more on the LLVM codebase. The benefit greatly
&gt; varies on the execution path, but it should not regress on performance.
&gt;
&gt; This is a recommit of cca01008cc31a891d0ec70aff2201b25d05d8f1b with
&gt; MemorySSA update fixes.
&gt;
&gt; Differential Revision: https://reviews.llvm.org/D137707

This reverts commit 50b2a113db197a97f60ad2aace8b7382dc9b8c31
and follow-up commit ad9ad3735c4821ff4651fab7537a75b8f0bb60f8.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This could also move initialization of sret args, causing actually
initialized parts of such return values to be uninitialized. See
discussion on the code review.

&gt; As a result of -ftrivial-auto-var-init, clang generates instructions to
&gt; set alloca'd memory to a given pattern, right after the allocation site.
&gt; In some cases, this (somehow costly) operation could be delayed, leading
&gt; to conditional execution in some cases.
&gt;
&gt; This is not an uncommon situation: it happens ~500 times on the cPython
&gt; code base, and much more on the LLVM codebase. The benefit greatly
&gt; varies on the execution path, but it should not regress on performance.
&gt;
&gt; This is a recommit of cca01008cc31a891d0ec70aff2201b25d05d8f1b with
&gt; MemorySSA update fixes.
&gt;
&gt; Differential Revision: https://reviews.llvm.org/D137707

This reverts commit 50b2a113db197a97f60ad2aace8b7382dc9b8c31
and follow-up commit ad9ad3735c4821ff4651fab7537a75b8f0bb60f8.
</pre>
</div>
</content>
</entry>
<entry>
<title>Do not move "auto-init" instruction if they're volatile</title>
<updated>2023-04-04T18:42:05+00:00</updated>
<author>
<name>serge-sans-paille</name>
<email>sguelton@mozilla.com</email>
</author>
<published>2023-04-04T18:38:25+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=ad9ad3735c4821ff4651fab7537a75b8f0bb60f8'/>
<id>ad9ad3735c4821ff4651fab7537a75b8f0bb60f8</id>
<content type='text'>
This is overly conservative, but at least it's safe.

This is a follow-up to https://reviews.llvm.org/D137707
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This is overly conservative, but at least it's safe.

This is a follow-up to https://reviews.llvm.org/D137707
</pre>
</div>
</content>
</entry>
</feed>
