<feed xmlns='http://www.w3.org/2005/Atom'>
<title>llvm-project.git/llvm/lib/CodeGen/GlobalMergeFunctions.cpp, branch users/meinersbur/flang_runtime_split-headers</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>[CGData][Merger] Avoid merging the attached call target (#121030)</title>
<updated>2024-12-27T19:59:25+00:00</updated>
<author>
<name>Kyungwoo Lee</name>
<email>kyulee@meta.com</email>
</author>
<published>2024-12-27T19:59:25+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=815343e7dd32cc4c5c903ac52daf87aaa4e4cd6e'/>
<id>815343e7dd32cc4c5c903ac52daf87aaa4e4cd6e</id>
<content type='text'>
For global function merging, the target of the arc-attached call must be
a constant and cannot be parameterized.
This change adds a check to bypass this case in `canParameterizeCallOperand()`.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
For global function merging, the target of the arc-attached call must be
a constant and cannot be parameterized.
This change adds a check to bypass this case in `canParameterizeCallOperand()`.</pre>
</div>
</content>
</entry>
<entry>
<title>[CGData] Change placeholder from `undef` to `poison` when initializing a vector [NFC] (#119134)</title>
<updated>2024-12-10T15:04:41+00:00</updated>
<author>
<name>Pedro Lobo</name>
<email>pedro.lobo@tecnico.ulisboa.pt</email>
</author>
<published>2024-12-10T15:04:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=20b071c0ebd9a5de7e1893cf6f1d6081819015c8'/>
<id>20b071c0ebd9a5de7e1893cf6f1d6081819015c8</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Reland [CGData][GMF] Skip No Params (#116548)</title>
<updated>2024-11-25T21:55:02+00:00</updated>
<author>
<name>Kyungwoo Lee</name>
<email>kyulee@meta.com</email>
</author>
<published>2024-11-25T18:57:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=fe69a20cc1e46bf8473aaef1be8a1805c80fc9d4'/>
<id>fe69a20cc1e46bf8473aaef1be8a1805c80fc9d4</id>
<content type='text'>
This update follows up on change #112671 and is mostly a NFC, with the following exceptions:
  - Introduced `-global-merging-skip-no-params` to bypass merging when no parameters are required.
  - Parameter count is now calculated based on the unique hash count.
  - Added `-global-merging-inst-overhead` to adjust the instruction overhead, reflecting the machine instruction size.
  - Costs and benefits are now computed using the double data type. Since the finalization process occurs offline, this should not significantly impact build time.
  - Moved a sorting operation outside of the loop.

This is a patch for
https://discourse.llvm.org/t/rfc-global-function-merging/82608.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This update follows up on change #112671 and is mostly a NFC, with the following exceptions:
  - Introduced `-global-merging-skip-no-params` to bypass merging when no parameters are required.
  - Parameter count is now calculated based on the unique hash count.
  - Added `-global-merging-inst-overhead` to adjust the instruction overhead, reflecting the machine instruction size.
  - Costs and benefits are now computed using the double data type. Since the finalization process occurs offline, this should not significantly impact build time.
  - Moved a sorting operation outside of the loop.

This is a patch for
https://discourse.llvm.org/t/rfc-global-function-merging/82608.
</pre>
</div>
</content>
</entry>
<entry>
<title>Revert "[CGData][GMF] Skip No Params (#116548)"</title>
<updated>2024-11-25T19:09:29+00:00</updated>
<author>
<name>Kyungwoo Lee</name>
<email>kyulee@meta.com</email>
</author>
<published>2024-11-25T19:09:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=fe3c23b439b9a2d00442d9bc6a4ca86f73066a3d'/>
<id>fe3c23b439b9a2d00442d9bc6a4ca86f73066a3d</id>
<content type='text'>
This reverts commit fdf1f69c57ac3667d27c35e097040284edb1f574.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This reverts commit fdf1f69c57ac3667d27c35e097040284edb1f574.
</pre>
</div>
</content>
</entry>
<entry>
<title>[CGData][GMF] Skip No Params (#116548)</title>
<updated>2024-11-25T18:57:41+00:00</updated>
<author>
<name>Kyungwoo Lee</name>
<email>kyulee@meta.com</email>
</author>
<published>2024-11-25T18:57:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=fdf1f69c57ac3667d27c35e097040284edb1f574'/>
<id>fdf1f69c57ac3667d27c35e097040284edb1f574</id>
<content type='text'>
This update follows up on change #112671 and is mostly a NFC, with the following exceptions:
  - Introduced `-global-merging-skip-no-params` to bypass merging when no parameters are required.
  - Parameter count is now calculated based on the unique hash count.
  - Added `-global-merging-inst-overhead` to adjust the instruction overhead, reflecting the machine instruction size.
  - Costs and benefits are now computed using the double data type. Since the finalization process occurs offline, this should not significantly impact build time.
  - Moved a sorting operation outside of the loop.

This is a patch for
https://discourse.llvm.org/t/rfc-global-function-merging/82608.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This update follows up on change #112671 and is mostly a NFC, with the following exceptions:
  - Introduced `-global-merging-skip-no-params` to bypass merging when no parameters are required.
  - Parameter count is now calculated based on the unique hash count.
  - Added `-global-merging-inst-overhead` to adjust the instruction overhead, reflecting the machine instruction size.
  - Costs and benefits are now computed using the double data type. Since the finalization process occurs offline, this should not significantly impact build time.
  - Moved a sorting operation outside of the loop.

This is a patch for
https://discourse.llvm.org/t/rfc-global-function-merging/82608.</pre>
</div>
</content>
</entry>
<entry>
<title>Fix crash from [CGData] Global Merge Functions (#112671) (#116241)</title>
<updated>2024-11-15T22:57:17+00:00</updated>
<author>
<name>Kyungwoo Lee</name>
<email>kyulee@meta.com</email>
</author>
<published>2024-11-15T22:57:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=816c975ea7b27a784c8f0d6a9b92571ebc97d4a3'/>
<id>816c975ea7b27a784c8f0d6a9b92571ebc97d4a3</id>
<content type='text'>
Module summary index is optional for this pass, and we shouldn't run it,
but import it as necessary.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Module summary index is optional for this pass, and we shouldn't run it,
but import it as necessary.</pre>
</div>
</content>
</entry>
<entry>
<title>Reland [CGData] Refactor Global Merge Functions (#115750)</title>
<updated>2024-11-14T23:27:17+00:00</updated>
<author>
<name>Kyungwoo Lee</name>
<email>kyulee@meta.com</email>
</author>
<published>2024-11-14T05:15:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=b3134fa2338388adf8cfb2d77339d0b042eab9f6'/>
<id>b3134fa2338388adf8cfb2d77339d0b042eab9f6</id>
<content type='text'>
This is a follow-up PR to refactor the initial global merge function
pass implemented in #112671.

It first collects stable functions relevant to the current module and
iterates over those only, instead of iterating through all stable
functions in the stable function map.

This is a patch for
https://discourse.llvm.org/t/rfc-global-function-merging/82608.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This is a follow-up PR to refactor the initial global merge function
pass implemented in #112671.

It first collects stable functions relevant to the current module and
iterates over those only, instead of iterating through all stable
functions in the stable function map.

This is a patch for
https://discourse.llvm.org/t/rfc-global-function-merging/82608.
</pre>
</div>
</content>
</entry>
<entry>
<title>Revert "[CGData] Refactor Global Merge Functions (#115750)"</title>
<updated>2024-11-14T05:23:16+00:00</updated>
<author>
<name>Kyungwoo Lee</name>
<email>kyulee@meta.com</email>
</author>
<published>2024-11-14T05:23:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=5a2888ddbd7a601c8ad6bf7b5f13bf77318e4a4d'/>
<id>5a2888ddbd7a601c8ad6bf7b5f13bf77318e4a4d</id>
<content type='text'>
This reverts commit d3da78863c7021fa2447a168dc03ad791db69dc6.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This reverts commit d3da78863c7021fa2447a168dc03ad791db69dc6.
</pre>
</div>
</content>
</entry>
<entry>
<title>[CGData] Refactor Global Merge Functions (#115750)</title>
<updated>2024-11-14T05:15:19+00:00</updated>
<author>
<name>Kyungwoo Lee</name>
<email>kyulee@meta.com</email>
</author>
<published>2024-11-14T05:15:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=d3da78863c7021fa2447a168dc03ad791db69dc6'/>
<id>d3da78863c7021fa2447a168dc03ad791db69dc6</id>
<content type='text'>
This is a follow-up PR to refactor the initial global merge function
pass implemented in #112671.

It first collects stable functions relevant to the current module and
iterates over those only, instead of iterating through all stable
functions in the stable function map.

This is a patch for
https://discourse.llvm.org/t/rfc-global-function-merging/82608.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This is a follow-up PR to refactor the initial global merge function
pass implemented in #112671.

It first collects stable functions relevant to the current module and
iterates over those only, instead of iterating through all stable
functions in the stable function map.

This is a patch for
https://discourse.llvm.org/t/rfc-global-function-merging/82608.</pre>
</div>
</content>
</entry>
<entry>
<title>[CGData] Global Merge Functions (#112671)</title>
<updated>2024-11-14T01:34:07+00:00</updated>
<author>
<name>Kyungwoo Lee</name>
<email>kyulee@meta.com</email>
</author>
<published>2024-11-14T01:34:07+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=d23c5c2d6566fce4380cfa31d438422db19fbce9'/>
<id>d23c5c2d6566fce4380cfa31d438422db19fbce9</id>
<content type='text'>
This implements a global function merging pass. Unlike traditional
function merging passes that use IR comparators, this pass employs a
structurally stable hash to identify similar functions while ignoring
certain constant operands. These ignored constants are tracked and
encoded into a stable function summary. When merging, instead of
explicitly folding similar functions and their call sites, we form a
merging instance by supplying different parameters via thunks. The
actual size reduction occurs when identically created merging instances
are folded by the linker.

Currently, this pass is wired to a pre-codegen pass, enabled by the
`-enable-global-merge-func` flag.
In a local merging mode, the analysis and merging steps occur
sequentially within a module:
- `analyze`: Collects stable function hashes and tracks locations of
ignored constant operands.
- `finalize`: Identifies merge candidates with matching hashes and
computes the set of parameters that point to different constants.
- `merge`: Uses the stable function map to optimistically create a
merged function.

We can enable a global merging mode similar to the global function
outliner
(https://discourse.llvm.org/t/rfc-enhanced-machine-outliner-part-2-thinlto-nolto/78753/),
which will perform the above steps separately.
- `-codegen-data-generate`: During the first round of code generation,
we analyze local merging instances and publish their summaries.
- Offline using `llvm-cgdata` or at link-time, we can finalize all these
merging summaries that are combined to determine parameters.
- `-codegen-data-use`: During the second round of code generation, we
optimistically create merging instances within each module, and finally,
the linker folds identically created merging instances.

Depends on #112664
This is a patch for
https://discourse.llvm.org/t/rfc-global-function-merging/82608.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This implements a global function merging pass. Unlike traditional
function merging passes that use IR comparators, this pass employs a
structurally stable hash to identify similar functions while ignoring
certain constant operands. These ignored constants are tracked and
encoded into a stable function summary. When merging, instead of
explicitly folding similar functions and their call sites, we form a
merging instance by supplying different parameters via thunks. The
actual size reduction occurs when identically created merging instances
are folded by the linker.

Currently, this pass is wired to a pre-codegen pass, enabled by the
`-enable-global-merge-func` flag.
In a local merging mode, the analysis and merging steps occur
sequentially within a module:
- `analyze`: Collects stable function hashes and tracks locations of
ignored constant operands.
- `finalize`: Identifies merge candidates with matching hashes and
computes the set of parameters that point to different constants.
- `merge`: Uses the stable function map to optimistically create a
merged function.

We can enable a global merging mode similar to the global function
outliner
(https://discourse.llvm.org/t/rfc-enhanced-machine-outliner-part-2-thinlto-nolto/78753/),
which will perform the above steps separately.
- `-codegen-data-generate`: During the first round of code generation,
we analyze local merging instances and publish their summaries.
- Offline using `llvm-cgdata` or at link-time, we can finalize all these
merging summaries that are combined to determine parameters.
- `-codegen-data-use`: During the second round of code generation, we
optimistically create merging instances within each module, and finally,
the linker folds identically created merging instances.

Depends on #112664
This is a patch for
https://discourse.llvm.org/t/rfc-global-function-merging/82608.</pre>
</div>
</content>
</entry>
</feed>
