<feed xmlns='http://www.w3.org/2005/Atom'>
<title>llvm-project.git/llvm/lib/Transforms/Utils/PromoteMemoryToRegister.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>[PromoteMem2Reg] Optimize memory usage in PromoteMem2Reg (#142474)</title>
<updated>2025-06-04T02:34:36+00:00</updated>
<author>
<name>Vitaly Buka</name>
<email>vitalybuka@google.com</email>
</author>
<published>2025-06-04T02:34:36+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=3531cc1cc777af5ea198c17c62f7324779b707e4'/>
<id>3531cc1cc777af5ea198c17c62f7324779b707e4</id>
<content type='text'>
When BasicBlock has a large number of allocas, and
successors, we had to copy entire IncomingVals and
IncomingLocs vectors for successors.

Also updates to IncomingVals and
IncomingLocs are infrequent (only Load/Store into
alloca affect arrays).

Given the nature of DFS traversal, instead of copying
the entire vector, we can keep track of the changes
and undo all changes done by successors.

Fixes #142461

On the attached to issue #142461 IR RSS drops from 35Gb to 1.8Gb.

But it does not affect compile time on average

https://llvm-compile-time-tracker.com/compare.php?from=2e98ed8caa0b47ee79af4ad24b5436a89fe49dfa&amp;to=effac6d1fd600e544f8bc21382c7e541973b1378&amp;stat=instructions:u</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When BasicBlock has a large number of allocas, and
successors, we had to copy entire IncomingVals and
IncomingLocs vectors for successors.

Also updates to IncomingVals and
IncomingLocs are infrequent (only Load/Store into
alloca affect arrays).

Given the nature of DFS traversal, instead of copying
the entire vector, we can keep track of the changes
and undo all changes done by successors.

Fixes #142461

On the attached to issue #142461 IR RSS drops from 35Gb to 1.8Gb.

But it does not affect compile time on average

https://llvm-compile-time-tracker.com/compare.php?from=2e98ed8caa0b47ee79af4ad24b5436a89fe49dfa&amp;to=effac6d1fd600e544f8bc21382c7e541973b1378&amp;stat=instructions:u</pre>
</div>
</content>
</entry>
<entry>
<title>[NFC][PromoteMem2Reg] Move IncomingVals, IncomingLocs, Worklist into class (#142468)</title>
<updated>2025-06-03T21:47:45+00:00</updated>
<author>
<name>Vitaly Buka</name>
<email>vitalybuka@google.com</email>
</author>
<published>2025-06-03T21:47:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=ac4893dd77eeb67be830b0dac70ad28c4b4f0caf'/>
<id>ac4893dd77eeb67be830b0dac70ad28c4b4f0caf</id>
<content type='text'>
They are all DFS state related, as `Visited`. But `Visited` is already a
class member, so we make things more consistent and less
parameters to pass around.

By itself, the patch has little value, but it simplifies stuff in the
#142474.

For #142461</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
They are all DFS state related, as `Visited`. But `Visited` is already a
class member, so we make things more consistent and less
parameters to pass around.

By itself, the patch has little value, but it simplifies stuff in the
#142474.

For #142461</pre>
</div>
</content>
</entry>
<entry>
<title>[NFCI][PromoteMem2Reg] Don't handle the first successor out of order (#142464)</title>
<updated>2025-06-03T17:26:55+00:00</updated>
<author>
<name>Vitaly Buka</name>
<email>vitalybuka@google.com</email>
</author>
<published>2025-06-03T17:26:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=3cb967a2cd9784d3846072121990bdfaa89b0d15'/>
<id>3cb967a2cd9784d3846072121990bdfaa89b0d15</id>
<content type='text'>
Just for consistency, to avoid confusing conditions.

`reverse` helps to avoid tests updates as nothing is
changing for for successors count &lt;=2.

For #142461</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Just for consistency, to avoid confusing conditions.

`reverse` helps to avoid tests updates as nothing is
changing for for successors count &lt;=2.

For #142461</pre>
</div>
</content>
</entry>
<entry>
<title>[NFC] Remove goto in PromoteMem2Reg::RenamePass (#142454)</title>
<updated>2025-06-03T16:14:04+00:00</updated>
<author>
<name>Vitaly Buka</name>
<email>vitalybuka@google.com</email>
</author>
<published>2025-06-03T16:14:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=b9dec5aa793fbdb3b5db6b240f28bd18f13dbc9e'/>
<id>b9dec5aa793fbdb3b5db6b240f28bd18f13dbc9e</id>
<content type='text'>
'goto' is essentially a shortcut for push/pop for worklist.
It can be expensive if we copy vectors, but if we move them, it
should not be an issue.

Without 'goto' it's easier to reason about the
code, when `PromoteMem2Reg::RenamePass` processes
exactly one edge at a time.

There is out of order processing of the first
successor, I keep it just to make this patch pure NFC. I'll
remove this in follow up patches.

For #142461</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
'goto' is essentially a shortcut for push/pop for worklist.
It can be expensive if we copy vectors, but if we move them, it
should not be an issue.

Without 'goto' it's easier to reason about the
code, when `PromoteMem2Reg::RenamePass` processes
exactly one edge at a time.

There is out of order processing of the first
successor, I keep it just to make this patch pure NFC. I'll
remove this in follow up patches.

For #142461</pre>
</div>
</content>
</entry>
<entry>
<title>[Utils] Use range-based for loops (NFC) (#139426)</title>
<updated>2025-05-11T05:50:46+00:00</updated>
<author>
<name>Kazu Hirata</name>
<email>kazu@google.com</email>
</author>
<published>2025-05-11T05:50:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=85f3d60d81023c86683efa0978f37c33027ba625'/>
<id>85f3d60d81023c86683efa0978f37c33027ba625</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>[Transforms] Use range constructors of *Set (NFC) (#133203)</title>
<updated>2025-03-27T14:51:58+00:00</updated>
<author>
<name>Kazu Hirata</name>
<email>kazu@google.com</email>
</author>
<published>2025-03-27T14:51:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=cde58bfc16d46417e55bb4d7614631ac84b72cc0'/>
<id>cde58bfc16d46417e55bb4d7614631ac84b72cc0</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>[reland][DebugInfo] Update DIBuilder insertion to take InsertPosition (#126967)</title>
<updated>2025-02-13T10:46:42+00:00</updated>
<author>
<name>Harald van Dijk</name>
<email>harald.vandijk@codeplay.com</email>
</author>
<published>2025-02-13T10:46:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=1083ec647f16314bcc9af8c4d6b11f50d288bca6'/>
<id>1083ec647f16314bcc9af8c4d6b11f50d288bca6</id>
<content type='text'>
After #124287 updated several functions to return iterators rather than
Instruction *, it was no longer straightforward to pass their result to
DIBuilder. This commit updates DIBuilder methods to accept an
InsertPosition instead, so that they can be called with an iterator
(preferred), or with a deprecation warning an Instruction *, or a
BasicBlock *. This commit also updates the existing calls to the
DIBuilder methods to pass in iterators.

As a special exception, DIBuilder::insertDeclare() keeps a separate
overload accepting a BasicBlock *InsertAtEnd. This is because despite
the name, this method does not insert at the end of the block, therefore
this cannot be handled implicitly by using InsertPosition.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
After #124287 updated several functions to return iterators rather than
Instruction *, it was no longer straightforward to pass their result to
DIBuilder. This commit updates DIBuilder methods to accept an
InsertPosition instead, so that they can be called with an iterator
(preferred), or with a deprecation warning an Instruction *, or a
BasicBlock *. This commit also updates the existing calls to the
DIBuilder methods to pass in iterators.

As a special exception, DIBuilder::insertDeclare() keeps a separate
overload accepting a BasicBlock *InsertAtEnd. This is because despite
the name, this method does not insert at the end of the block, therefore
this cannot be handled implicitly by using InsertPosition.</pre>
</div>
</content>
</entry>
<entry>
<title>Revert "[DebugInfo] Update DIBuilder insertion to take InsertPosition (#126059)"</title>
<updated>2025-02-12T17:50:39+00:00</updated>
<author>
<name>Harald van Dijk</name>
<email>harald.vandijk@codeplay.com</email>
</author>
<published>2025-02-12T17:50:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=23209eb1d9df57ca3419f5abc6b2edcdc0d1dead'/>
<id>23209eb1d9df57ca3419f5abc6b2edcdc0d1dead</id>
<content type='text'>
This reverts commit 3ec9f7494b31f2fe51d5ed0e07adcf4b7199def6.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This reverts commit 3ec9f7494b31f2fe51d5ed0e07adcf4b7199def6.
</pre>
</div>
</content>
</entry>
<entry>
<title>[DebugInfo] Update DIBuilder insertion to take InsertPosition (#126059)</title>
<updated>2025-02-12T17:38:59+00:00</updated>
<author>
<name>Harald van Dijk</name>
<email>harald.vandijk@codeplay.com</email>
</author>
<published>2025-02-12T17:38:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=3ec9f7494b31f2fe51d5ed0e07adcf4b7199def6'/>
<id>3ec9f7494b31f2fe51d5ed0e07adcf4b7199def6</id>
<content type='text'>
After #124287 updated several functions to return iterators rather than
Instruction *, it was no longer straightforward to pass their result to
DIBuilder. This commit updates DIBuilder methods to accept an
InsertPosition instead, so that they can be called with an iterator
(preferred), or with a deprecation warning an Instruction *, or a
BasicBlock *. This commit also updates the existing calls to the
DIBuilder methods to pass in iterators.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
After #124287 updated several functions to return iterators rather than
Instruction *, it was no longer straightforward to pass their result to
DIBuilder. This commit updates DIBuilder methods to accept an
InsertPosition instead, so that they can be called with an iterator
(preferred), or with a deprecation warning an Instruction *, or a
BasicBlock *. This commit also updates the existing calls to the
DIBuilder methods to pass in iterators.</pre>
</div>
</content>
</entry>
<entry>
<title>[NFC][DebugInfo] Use iterator moveBefore at many call-sites (#123583)</title>
<updated>2025-01-24T10:53:11+00:00</updated>
<author>
<name>Jeremy Morse</name>
<email>jeremy.morse@sony.com</email>
</author>
<published>2025-01-24T10:53:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=8e702735090388a3231a863e343f880d0f96fecb'/>
<id>8e702735090388a3231a863e343f880d0f96fecb</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 moveBefore use iterators.

This patch adds a (guaranteed dereferenceable) iterator-taking
moveBefore, and changes a bunch of call-sites where it's obviously safe
to change to use it by just calling getIterator() on an instruction
pointer. A follow-up patch will contain less-obviously-safe changes.

We'll eventually deprecate and remove the instruction-pointer
insertBefore, but not before adding concise documentation of what
considerations are needed (very few).</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 moveBefore use iterators.

This patch adds a (guaranteed dereferenceable) iterator-taking
moveBefore, and changes a bunch of call-sites where it's obviously safe
to change to use it by just calling getIterator() on an instruction
pointer. A follow-up patch will contain less-obviously-safe changes.

We'll eventually deprecate and remove the instruction-pointer
insertBefore, but not before adding concise documentation of what
considerations are needed (very few).</pre>
</div>
</content>
</entry>
</feed>
