<feed xmlns='http://www.w3.org/2005/Atom'>
<title>llvm-project.git/llvm/lib/Transforms/Utils/CloneFunction.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>Follow-up to 97ac6483aae, squelch an unused lambda capture warning</title>
<updated>2025-06-12T11:04:41+00:00</updated>
<author>
<name>Jeremy Morse</name>
<email>jeremy.morse@sony.com</email>
</author>
<published>2025-06-12T11:04:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=013034cd0f5ae19ef02fc35a83362874e727f13c'/>
<id>013034cd0f5ae19ef02fc35a83362874e727f13c</id>
<content type='text'>
NewBB here was being captured for some code that was deleted in
97ac6483aae, and that leads to some warnings on some compilers.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
NewBB here was being captured for some code that was deleted in
97ac6483aae, and that leads to some warnings on some compilers.
</pre>
</div>
</content>
</entry>
<entry>
<title>[DebugInfo][RemoveDIs] Delete debug-info-format flag (#143746)</title>
<updated>2025-06-12T10:51:58+00:00</updated>
<author>
<name>Jeremy Morse</name>
<email>jeremy.morse@sony.com</email>
</author>
<published>2025-06-12T10:51:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=97ac6483aaead89897d9bda8a12f1f4c11fad621'/>
<id>97ac6483aaead89897d9bda8a12f1f4c11fad621</id>
<content type='text'>
This flag was used to let us incrementally introduce debug records
into LLVM, however everything is now using records. It serves no
purpose now, so delete it.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This flag was used to let us incrementally introduce debug records
into LLVM, however everything is now using records. It serves no
purpose now, so delete it.</pre>
</div>
</content>
</entry>
<entry>
<title>[CloneFunction][DebugInfo] Ensure DILocalVariables of inlined functions are not cloned (NFC) (#138590)</title>
<updated>2025-05-14T17:41:56+00:00</updated>
<author>
<name>Vladislav Dzhidzhoev</name>
<email>vdzhidzhoev@accesssoftek.com</email>
</author>
<published>2025-05-14T17:41:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=47144a0dc1f987981da14c18af9dbf962a6eb9c7'/>
<id>47144a0dc1f987981da14c18af9dbf962a6eb9c7</id>
<content type='text'>
This change was separated from
https://github.com/llvm/llvm-project/pull/119001.

When cloning functions, use IdentityMDPredicate to ensure that if
DISubprogram is not cloned, then its DILocalVariables are not cloned
either.

This is currently expected to be an NFC, as DILocalVariables only
reference their subprograms (via DILocalScopes) and types, and inlined
DISubprograms and DITypes are not cloned. Thus, DILocalVariables are
mapped to self in ValueMapper (in mapTopLevelUniquedNode).

However, it will be needed for the original PR
https://github.com/llvm/llvm-project/pull/119001, where a
DILocalVariable may refer to a local type of a DISubprogram that is
being cloned. In that case, ValueMapper will clone DILocalVariable even
if it belongs to an inlined DISubprogram that is not cloned, which
should be avoided.
I'm making this change into a separate PR to make the original PR a bit
smaller, and because this has more to do with variables than with types.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This change was separated from
https://github.com/llvm/llvm-project/pull/119001.

When cloning functions, use IdentityMDPredicate to ensure that if
DISubprogram is not cloned, then its DILocalVariables are not cloned
either.

This is currently expected to be an NFC, as DILocalVariables only
reference their subprograms (via DILocalScopes) and types, and inlined
DISubprograms and DITypes are not cloned. Thus, DILocalVariables are
mapped to self in ValueMapper (in mapTopLevelUniquedNode).

However, it will be needed for the original PR
https://github.com/llvm/llvm-project/pull/119001, where a
DILocalVariable may refer to a local type of a DISubprogram that is
being cloned. In that case, ValueMapper will clone DILocalVariable even
if it belongs to an inlined DISubprogram that is not cloned, which
should be avoided.
I'm making this change into a separate PR to make the original PR a bit
smaller, and because this has more to do with variables than with types.</pre>
</div>
</content>
</entry>
<entry>
<title>[Utils] Remove redundant calls to std::unique_ptr&lt;T&gt;::get (NFC) (#139352)</title>
<updated>2025-05-10T14:27:29+00:00</updated>
<author>
<name>Kazu Hirata</name>
<email>kazu@google.com</email>
</author>
<published>2025-05-10T14:27:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=6e4f501b1b67b9d45cbf97b959d43e776983b9c6'/>
<id>6e4f501b1b67b9d45cbf97b959d43e776983b9c6</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>[NFC][KeyInstr] Add Atom Group (re)mapping (#133479)</title>
<updated>2025-05-06T12:04:09+00:00</updated>
<author>
<name>Orlando Cazalet-Hyams</name>
<email>orlando.hyams@sony.com</email>
</author>
<published>2025-05-06T12:04:09+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=3b4f9c544274392198de084b84a5f2e5506e4703'/>
<id>3b4f9c544274392198de084b84a5f2e5506e4703</id>
<content type='text'>
Add:
mapAtomInstance - map the atom group number to a new group.
RemapSourceAtom - apply the mapped atom group number to this instruction.

Modify:
CloneBasicBlock - Call mapAtomInstance on cloned instruction's DebugLocs
if MapAtoms is true (default). Setting to false could
lead to a degraded debugging experience. See code comment.

Optimisations like loop unroll that duplicate instructions need to remap source
atom groups so that each duplicated source construct instance is considered
distinct when determining is_stmt locations.

This commit adds the remapping functionality and a unittest.

RFC:
https://discourse.llvm.org/t/rfc-improving-is-stmt-placement-for-better-interactive-debugging/82668</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Add:
mapAtomInstance - map the atom group number to a new group.
RemapSourceAtom - apply the mapped atom group number to this instruction.

Modify:
CloneBasicBlock - Call mapAtomInstance on cloned instruction's DebugLocs
if MapAtoms is true (default). Setting to false could
lead to a degraded debugging experience. See code comment.

Optimisations like loop unroll that duplicate instructions need to remap source
atom groups so that each duplicated source construct instance is considered
distinct when determining is_stmt locations.

This commit adds the remapping functionality and a unittest.

RFC:
https://discourse.llvm.org/t/rfc-improving-is-stmt-placement-for-better-interactive-debugging/82668</pre>
</div>
</content>
</entry>
<entry>
<title>[DebugInfo][Inline] Propagate source locs when simplifying cond branches (#134827)</title>
<updated>2025-04-09T15:52:05+00:00</updated>
<author>
<name>Stephen Tozer</name>
<email>stephen.tozer@sony.com</email>
</author>
<published>2025-04-09T15:52:05+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=5039bf4e26f07f9082e42374a342b3f52236e3fc'/>
<id>5039bf4e26f07f9082e42374a342b3f52236e3fc</id>
<content type='text'>
During inlining, we may opportunistically simplify conditional branches
(incl. switches) to unconditional branches if, after inlining, their
destination is fixed. While we do this, we should propagate any
DILocation attached to the original branch to the simplified branch,
which this patch enables.

Found using https://github.com/llvm/llvm-project/pull/107279.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
During inlining, we may opportunistically simplify conditional branches
(incl. switches) to unconditional branches if, after inlining, their
destination is fixed. While we do this, we should propagate any
DILocation attached to the original branch to the simplified branch,
which this patch enables.

Found using https://github.com/llvm/llvm-project/pull/107279.</pre>
</div>
</content>
</entry>
<entry>
<title>CloneFunction: Do not delete blocks with address taken (#134209)</title>
<updated>2025-04-03T16:52:25+00:00</updated>
<author>
<name>Matt Arsenault</name>
<email>Matthew.Arsenault@amd.com</email>
</author>
<published>2025-04-03T16:52:25+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=a54736afd5b8f8ed25550a9f456afd36e49c04e0'/>
<id>a54736afd5b8f8ed25550a9f456afd36e49c04e0</id>
<content type='text'>
If a block with a single predecessor also had its address taken,
it was getting deleted in this post-inline cleanup step. This would
result in the blockaddress in the resulting function getting deleted
and replaced with inttoptr 1.

This fixes one bug required to permit inlining of functions with blockaddress 
uses.

At the moment this is not testable (at least without an annoyingly complex
unit test),  and is a pre-bug fix for future patches. Functions with
blockaddress uses are rejected in isInlineViable, so we don't get this far
with the current InlineFunction uses (some of the existing cases seem to
reproduce this part of the rejection logic, like PartialInliner). This
will be tested in a pending llvm-reduce change.

Prerequisite for #38908</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
If a block with a single predecessor also had its address taken,
it was getting deleted in this post-inline cleanup step. This would
result in the blockaddress in the resulting function getting deleted
and replaced with inttoptr 1.

This fixes one bug required to permit inlining of functions with blockaddress 
uses.

At the moment this is not testable (at least without an annoyingly complex
unit test),  and is a pre-bug fix for future patches. Functions with
blockaddress uses are rejected in isInlineViable, so we don't get this far
with the current InlineFunction uses (some of the existing cases seem to
reproduce this part of the rejection logic, like PartialInliner). This
will be tested in a pending llvm-reduce change.

Prerequisite for #38908</pre>
</div>
</content>
</entry>
<entry>
<title>[Transforms] Use *Set::insert_range (NFC) (#132652)</title>
<updated>2025-03-24T02:42:53+00:00</updated>
<author>
<name>Kazu Hirata</name>
<email>kazu@google.com</email>
</author>
<published>2025-03-24T02:42:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=73dc2afd2c334aac735caba94292052d63014c9d'/>
<id>73dc2afd2c334aac735caba94292052d63014c9d</id>
<content type='text'>
We can use *Set::insert_range to collapse:

  for (auto Elem : Range)
    Set.insert(E);

down to:

  Set.insert_range(Range);

In some cases, we can further fold that into the set declaration.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
We can use *Set::insert_range to collapse:

  for (auto Elem : Range)
    Set.insert(E);

down to:

  Set.insert_range(Range);

In some cases, we can further fold that into the set declaration.</pre>
</div>
</content>
</entry>
<entry>
<title>[NFC][Cloning] Move DebugInfoFinder decl closer to its place of usage (#129154)</title>
<updated>2025-03-16T11:25:42+00:00</updated>
<author>
<name>Artem Pianykh</name>
<email>artem.pyanykh@gmail.com</email>
</author>
<published>2025-03-16T11:25:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=dc9a183ac6aa2d087ceac56970255b06c4772ca3'/>
<id>dc9a183ac6aa2d087ceac56970255b06c4772ca3</id>
<content type='text'>
Summary:
This makes it clear that DIFinder is only really necessary for llvm.dbg.cu update.

Test Plan:
ninja check-llvm-unit</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Summary:
This makes it clear that DIFinder is only really necessary for llvm.dbg.cu update.

Test Plan:
ninja check-llvm-unit</pre>
</div>
</content>
</entry>
<entry>
<title>[NFC][Cloning] Clean up comments in CloneFunctionInto (#129153)</title>
<updated>2025-03-15T19:28:23+00:00</updated>
<author>
<name>Artem Pianykh</name>
<email>artem.pyanykh@gmail.com</email>
</author>
<published>2025-03-15T19:28:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=fc6fd6a2f119c4d2666e0cb499c59068f39944e2'/>
<id>fc6fd6a2f119c4d2666e0cb499c59068f39944e2</id>
<content type='text'>
Summary:
Some comments no longer make sense nor refer to an existing code path.

Test Plan:
ninja check-llvm-unit</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Summary:
Some comments no longer make sense nor refer to an existing code path.

Test Plan:
ninja check-llvm-unit</pre>
</div>
</content>
</entry>
</feed>
