<feed xmlns='http://www.w3.org/2005/Atom'>
<title>llvm-project.git/llvm/lib/Transforms/IPO/MergeFunctions.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>[DebugInfo] Suppress lots of users of DbgValueInst (#149476)</title>
<updated>2025-07-18T10:31:52+00:00</updated>
<author>
<name>Jeremy Morse</name>
<email>jeremy.morse@sony.com</email>
</author>
<published>2025-07-18T10:31:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=c9d8b68676dbf51996a76475313088f750697343'/>
<id>c9d8b68676dbf51996a76475313088f750697343</id>
<content type='text'>
This is another prune of dead code -- we never generate debug intrinsics
nowadays, therefore there's no need for these codepaths to run.

---------

Co-authored-by: Nikita Popov &lt;github@npopov.com&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This is another prune of dead code -- we never generate debug intrinsics
nowadays, therefore there's no need for these codepaths to run.

---------

Co-authored-by: Nikita Popov &lt;github@npopov.com&gt;</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>[Transforms] Remove unused includes (NFC) (#141357)</title>
<updated>2025-05-24T16:37:43+00:00</updated>
<author>
<name>Kazu Hirata</name>
<email>kazu@google.com</email>
</author>
<published>2025-05-24T16:37:43+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=0ef8ef66cc7a89c55ddeb739b0e3b807b4d2947c'/>
<id>0ef8ef66cc7a89c55ddeb739b0e3b807b4d2947c</id>
<content type='text'>
These are identified by misc-include-cleaner.  I've filtered out those
that break builds.  Also, I'm staying away from llvm-config.h,
config.h, and Compiler.h, which likely cause platform- or
compiler-specific build failures.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
These are identified by misc-include-cleaner.  I've filtered out those
that break builds.  Also, I'm staying away from llvm-config.h,
config.h, and Compiler.h, which likely cause platform- or
compiler-specific build failures.</pre>
</div>
</content>
</entry>
<entry>
<title>[MergeFunc] Fix crash caused by bitcasting ArrayType (#133259)</title>
<updated>2025-04-04T09:16:40+00:00</updated>
<author>
<name>Tobias Stadler</name>
<email>mail@stadler-tobias.de</email>
</author>
<published>2025-04-04T09:16:40+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=1302610f03a1f10c2eea4c66445ccba4c52887b6'/>
<id>1302610f03a1f10c2eea4c66445ccba4c52887b6</id>
<content type='text'>
createCast in MergeFunctions did not consider ArrayTypes, which results
in the creation of a bitcast between ArrayTypes in the thunk function,
leading to an assertion failure in the provided test case.

The version of createCast in GlobalMergeFunctions does handle
ArrayTypes, so this common code has been factored out into the
IRBuilder.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
createCast in MergeFunctions did not consider ArrayTypes, which results
in the creation of a bitcast between ArrayTypes in the thunk function,
leading to an assertion failure in the provided test case.

The version of createCast in GlobalMergeFunctions does handle
ArrayTypes, so this common code has been factored out into the
IRBuilder.</pre>
</div>
</content>
</entry>
<entry>
<title>[Transforms] Use *Set::insert_range (NFC) (#132056)</title>
<updated>2025-03-19T22:35:01+00:00</updated>
<author>
<name>Kazu Hirata</name>
<email>kazu@google.com</email>
</author>
<published>2025-03-19T22:35:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=0dcc201ac410fed1595d4c8cabe6f9919598e208'/>
<id>0dcc201ac410fed1595d4c8cabe6f9919598e208</id>
<content type='text'>
DenseSet, SmallPtrSet, SmallSet, SetVector, and StringSet recently
gained C++23-style insert_range.  This patch replaces:

  Dest.insert(Src.begin(), Src.end());

with:

  Dest.insert_range(Src);

This patch does not touch custom begin like succ_begin for now.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
DenseSet, SmallPtrSet, SmallSet, SetVector, and StringSet recently
gained C++23-style insert_range.  This patch replaces:

  Dest.insert(Src.begin(), Src.end());

with:

  Dest.insert_range(Src);

This patch does not touch custom begin like succ_begin for now.</pre>
</div>
</content>
</entry>
<entry>
<title>[MergeFunc] Keep comdat on new function, not thunk. (#130583)</title>
<updated>2025-03-10T18:14:32+00:00</updated>
<author>
<name>Florian Hahn</name>
<email>flo@fhahn.com</email>
</author>
<published>2025-03-10T18:14:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=c7f7ac759110cdcf0d9180515a414c494154d213'/>
<id>c7f7ac759110cdcf0d9180515a414c494154d213</id>
<content type='text'>
MergeFunc uses the original function F as Thunk and creates a new function NewF for the original function F. Preserve F's comdat info on NewF instead of the thunk.

This fixes a crash when trying to lower comdat on the thunk during codegen.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
MergeFunc uses the original function F as Thunk and creates a new function NewF for the original function F. Preserve F's comdat info on NewF instead of the thunk.

This fixes a crash when trying to lower comdat on the thunk during codegen.</pre>
</div>
</content>
</entry>
<entry>
<title>[MergeFunc] Remove discardables function before writing alias or thunk. (#128865)</title>
<updated>2025-02-27T15:27:05+00:00</updated>
<author>
<name>Florian Hahn</name>
<email>flo@fhahn.com</email>
</author>
<published>2025-02-27T15:27:05+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=3afc3f43f0ba155e9655367c8bfa25eff5dfaf0f'/>
<id>3afc3f43f0ba155e9655367c8bfa25eff5dfaf0f</id>
<content type='text'>
Update writeThunkOrAlias to only create an alias or thunk if it is
actually needed. Drop discardable linkone_odr functions if they are not
used before.

PR: https://github.com/llvm/llvm-project/pull/128865</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Update writeThunkOrAlias to only create an alias or thunk if it is
actually needed. Drop discardable linkone_odr functions if they are not
used before.

PR: https://github.com/llvm/llvm-project/pull/128865</pre>
</div>
</content>
</entry>
<entry>
<title>[MergeFuncs] Don't introduce calls to (linkonce,weak)_odr functions. (#125050)</title>
<updated>2025-02-25T15:55:25+00:00</updated>
<author>
<name>Florian Hahn</name>
<email>flo@fhahn.com</email>
</author>
<published>2025-02-25T15:55:25+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=f10e0f7321b34693697a0bf895d440f82b32ba54'/>
<id>f10e0f7321b34693697a0bf895d440f82b32ba54</id>
<content type='text'>
Avoid creating new calls to linkonce_odr/weak_odr functions when
merging 2 functions, as this may introduce an infinite call
cycle.

Consider 2 functions below, both present in 2 modules. 

Module X

--
define linkonce_odr void @"A"() {
  call void @"foo"()
}

define linkonce_odr void @"B"() {
  call void @"foo"()
}
--- 

Module Y
---
global @"g" = @"B"

define linkonce_odr void @"A"() {
  %l = load @"g"
  call void %l()
}

define linkonce_odr void @"B"() {
  call void @"foo"()
}
---

 @"A" and @"B" in both modules are semantically equivalent

Module X after function merging:

---
define linkonce_odr void @"A"() {
  call void @"foo"()
}

define linkonce_odr void @"B"() {
  call void @"A"()
}
---

Module Y is unchanged.

Then the linker picks @"A" from module Y and @"B" from module X. Now there's an infinite call cycle


PR: https://github.com/llvm/llvm-project/pull/125050</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Avoid creating new calls to linkonce_odr/weak_odr functions when
merging 2 functions, as this may introduce an infinite call
cycle.

Consider 2 functions below, both present in 2 modules. 

Module X

--
define linkonce_odr void @"A"() {
  call void @"foo"()
}

define linkonce_odr void @"B"() {
  call void @"foo"()
}
--- 

Module Y
---
global @"g" = @"B"

define linkonce_odr void @"A"() {
  %l = load @"g"
  call void %l()
}

define linkonce_odr void @"B"() {
  call void @"foo"()
}
---

 @"A" and @"B" in both modules are semantically equivalent

Module X after function merging:

---
define linkonce_odr void @"A"() {
  call void @"foo"()
}

define linkonce_odr void @"B"() {
  call void @"A"()
}
---

Module Y is unchanged.

Then the linker picks @"A" from module Y and @"B" from module X. Now there's an infinite call cycle


PR: https://github.com/llvm/llvm-project/pull/125050</pre>
</div>
</content>
</entry>
<entry>
<title>[MergeFunctions] Add support to run the pass over a set of function pointers (#111045)</title>
<updated>2024-11-28T15:18:52+00:00</updated>
<author>
<name>Rafael Eckstein</name>
<email>44746868+Casperento@users.noreply.github.com</email>
</author>
<published>2024-11-28T15:18:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=2a6e5896a572c3be47ffe78afed8ba6ef278d336'/>
<id>2a6e5896a572c3be47ffe78afed8ba6ef278d336</id>
<content type='text'>
This modification will enable the usage of `MergeFunctions` as a
standalone library. Currently, `MergeFunctions` can only be applied to
an entire module. By adopting this change, developers will gain the
flexibility to reuse the `MergeFunctions` code within their own
projects, choosing which functions to merge; hence, promoting code
reusability. Notice that this modification will not break backward
compatibility, because `MergeFunctions` will still work as a pass after
the modification.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This modification will enable the usage of `MergeFunctions` as a
standalone library. Currently, `MergeFunctions` can only be applied to
an entire module. By adopting this change, developers will gain the
flexibility to reuse the `MergeFunctions` code within their own
projects, choosing which functions to merge; hence, promoting code
reusability. Notice that this modification will not break backward
compatibility, because `MergeFunctions` will still work as a pass after
the modification.</pre>
</div>
</content>
</entry>
<entry>
<title>[IPO] Remove unused includes (NFC) (#114716)</title>
<updated>2024-11-03T21:48:55+00:00</updated>
<author>
<name>Kazu Hirata</name>
<email>kazu@google.com</email>
</author>
<published>2024-11-03T21:48:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=98ea1a81a28a6dd36941456c8ab4ce46f665f57a'/>
<id>98ea1a81a28a6dd36941456c8ab4ce46f665f57a</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>
</feed>
