<feed xmlns='http://www.w3.org/2005/Atom'>
<title>llvm-project.git/llvm/test/Transforms/FunctionSpecialization/function-specialization-recursive2.ll, 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>[FuncSpec] Adjust the names of specializations and promoted stack values</title>
<updated>2023-09-19T13:40:31+00:00</updated>
<author>
<name>Alexandros Lamprineas</name>
<email>alexandros.lamprineas@arm.com</email>
</author>
<published>2023-09-19T13:40:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=e15d72adac66790a78a51a3087b56b2bde6b778a'/>
<id>e15d72adac66790a78a51a3087b56b2bde6b778a</id>
<content type='text'>
Currently the naming scheme is a bit funky; the specializations are named
after the original function followed by an arbitrary decimal number. This
makes it hard to debug inlined specializations of recursive functions.
With this patch I am adding ".specialized." in between of the original
name and the suffix, which is now a single increment counter.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Currently the naming scheme is a bit funky; the specializations are named
after the original function followed by an arbitrary decimal number. This
makes it hard to debug inlined specializations of recursive functions.
With this patch I am adding ".specialized." in between of the original
name and the suffix, which is now a single increment counter.</pre>
</div>
</content>
</entry>
<entry>
<title>[FuncSpec][NFC] Command line option renaming.</title>
<updated>2023-03-15T18:03:44+00:00</updated>
<author>
<name>Alexandros Lamprineas</name>
<email>alexandros.lamprineas@arm.com</email>
</author>
<published>2023-03-03T15:29:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=9627bcdeac33a3c2752035455228299155c82046'/>
<id>9627bcdeac33a3c2752035455228299155c82046</id>
<content type='text'>
Standardize all options with 'funcspec' prefix and shorter abreviations.

Differential Revision: https://reviews.llvm.org/D145378
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Standardize all options with 'funcspec' prefix and shorter abreviations.

Differential Revision: https://reviews.llvm.org/D145378
</pre>
</div>
</content>
</entry>
<entry>
<title>[IPSCCP] Create a Pass parameter to control specialization of functions.</title>
<updated>2022-12-23T16:54:45+00:00</updated>
<author>
<name>Alexandros Lamprineas</name>
<email>alexandros.lamprineas@arm.com</email>
</author>
<published>2022-12-22T17:44:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=f952bc05fda6647bedadf552c5aa5b00672861fc'/>
<id>f952bc05fda6647bedadf552c5aa5b00672861fc</id>
<content type='text'>
Required for D140210 in order to disable FuncSpec at {Os, Oz}
optimization levels.

Differential Revision: https://reviews.llvm.org/D140564
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Required for D140210 in order to disable FuncSpec at {Os, Oz}
optimization levels.

Differential Revision: https://reviews.llvm.org/D140564
</pre>
</div>
</content>
</entry>
<entry>
<title>[FuncSpec] Make the Function Specializer part of the IPSCCP pass.</title>
<updated>2022-12-10T14:39:49+00:00</updated>
<author>
<name>Alexandros Lamprineas</name>
<email>alexandros.lamprineas@arm.com</email>
</author>
<published>2022-12-09T17:41:05+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=8136a0172b3ce04975650732cc3cc9da89908211'/>
<id>8136a0172b3ce04975650732cc3cc9da89908211</id>
<content type='text'>
Reland 877a9f9abec61f06e39f1cd872e37b828139c2d1 since D138654 (parent)
has been fixed with 9ebaf4fef4aac89d4eff08e48185d61bc893f14e and with
8f1e11c5a7d70f96943a72649daa69f152d73e90.

Differential Revision: https://reviews.llvm.org/D126455
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Reland 877a9f9abec61f06e39f1cd872e37b828139c2d1 since D138654 (parent)
has been fixed with 9ebaf4fef4aac89d4eff08e48185d61bc893f14e and with
8f1e11c5a7d70f96943a72649daa69f152d73e90.

Differential Revision: https://reviews.llvm.org/D126455
</pre>
</div>
</content>
</entry>
<entry>
<title>Revert "[FuncSpec] Make the Function Specializer part of the IPSCCP pass."</title>
<updated>2022-12-08T12:41:43+00:00</updated>
<author>
<name>Alexandros Lamprineas</name>
<email>alexandros.lamprineas@arm.com</email>
</author>
<published>2022-12-08T12:38:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=0f0cb92cb2ad3aeb6479acaa5bfbdefd17b764a7'/>
<id>0f0cb92cb2ad3aeb6479acaa5bfbdefd17b764a7</id>
<content type='text'>
This reverts commit 877a9f9abec61f06e39f1cd872e37b828139c2d1.

It depends on the parent revision 42c2dc401742266da3e0251b6c1ca491f4779963
which needs to be reverted as it broke some buildbots, so reverting both.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This reverts commit 877a9f9abec61f06e39f1cd872e37b828139c2d1.

It depends on the parent revision 42c2dc401742266da3e0251b6c1ca491f4779963
which needs to be reverted as it broke some buildbots, so reverting both.
</pre>
</div>
</content>
</entry>
<entry>
<title>[FuncSpec] Make the Function Specializer part of the IPSCCP pass.</title>
<updated>2022-12-08T12:14:27+00:00</updated>
<author>
<name>Alexandros Lamprineas</name>
<email>alexandros.lamprineas@arm.com</email>
</author>
<published>2022-11-28T21:47:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=877a9f9abec61f06e39f1cd872e37b828139c2d1'/>
<id>877a9f9abec61f06e39f1cd872e37b828139c2d1</id>
<content type='text'>
The aim of this patch is to minimize the compilation time overhead of
running Function Specialization. It is about 40% slower to run as a
standalone pass (IPSCCP + FuncSpec vs IPSCCP with FuncSpec) according
to my measurements. I compiled the llvm testsuite with NewPM-O3 + LTO
and measured single threaded [user + system] time of IPSCCP and FuncSpec
by passing the '-time-passes' option to lld. Then I compared the two
configurations in terms of Instruction Count of the total compilation
(not of the individual passes) as in https://llvm-compile-time-tracker.com.
Geomean for non-LTO builds is -0.25% and LTO is -0.5% approximately.

You can find more info below:

https://discourse.llvm.org/t/rfc-should-we-enable-function-specialization/61518

Differential Revision: https://reviews.llvm.org/D126455
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The aim of this patch is to minimize the compilation time overhead of
running Function Specialization. It is about 40% slower to run as a
standalone pass (IPSCCP + FuncSpec vs IPSCCP with FuncSpec) according
to my measurements. I compiled the llvm testsuite with NewPM-O3 + LTO
and measured single threaded [user + system] time of IPSCCP and FuncSpec
by passing the '-time-passes' option to lld. Then I compared the two
configurations in terms of Instruction Count of the total compilation
(not of the individual passes) as in https://llvm-compile-time-tracker.com.
Geomean for non-LTO builds is -0.25% and LTO is -0.5% approximately.

You can find more info below:

https://discourse.llvm.org/t/rfc-should-we-enable-function-specialization/61518

Differential Revision: https://reviews.llvm.org/D126455
</pre>
</div>
</content>
</entry>
<entry>
<title>[NFC] Port all FunctionSpecialization tests to `-passes=` syntax</title>
<updated>2022-12-07T23:38:43+00:00</updated>
<author>
<name>Roman Lebedev</name>
<email>lebedev.ri@gmail.com</email>
</author>
<published>2022-12-07T23:27:20+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=a1314b2f6256ae10e2c9ce2b6efd6c9c77da6aaa'/>
<id>a1314b2f6256ae10e2c9ce2b6efd6c9c77da6aaa</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>FunctionSpecialization: Convert tests to opaque pointers</title>
<updated>2022-11-28T14:35:48+00:00</updated>
<author>
<name>Matt Arsenault</name>
<email>Matthew.Arsenault@amd.com</email>
</author>
<published>2022-11-26T22:32:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=ebdf5aefcb75ed52f44227a85b190bd26a01dddd'/>
<id>ebdf5aefcb75ed52f44227a85b190bd26a01dddd</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>[FuncSpec] Support specialising recursive functions</title>
<updated>2021-08-04T07:07:04+00:00</updated>
<author>
<name>Sjoerd Meijer</name>
<email>sjoerd.meijer@arm.com</email>
</author>
<published>2021-08-03T19:42:09+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=30fbb06979077740961ebc46853e28ab1f999f9d'/>
<id>30fbb06979077740961ebc46853e28ab1f999f9d</id>
<content type='text'>
This adds support for specialising recursive functions. For example:

    int Global = 1;
    void recursiveFunc(int *arg) {
      if (*arg &lt; 4) {
        print(*arg);
        recursiveFunc(*arg + 1);
      }
    }
    void main() {
      recursiveFunc(&amp;Global);
    }

After 3 iterations of function specialisation, followed by inlining of the
specialised versions of recursiveFunc, the main function looks like this:

    void main() {
      print(1);
      print(2);
      print(3);
    }

To support this, the following has been added:
- Update the solver and state of the new specialised functions,
- An optimisation to propagate constant stack values after each iteration of
  function specialisation, which is necessary for the next iteration to
  recognise the constant values and trigger.

Specialising recursive functions is (at the moment) controlled by option
-func-specialization-max-iters and is opt-in for compile-time reasons. I.e.,
the default is -func-specialization-max-iters=1, but for the example above we
would need to use -func-specialization-max-iters=3. Future work is to see if we
can increase the default, or improve the cost-model/heuristics to control
compile-times.

Differential Revision: https://reviews.llvm.org/D106426
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This adds support for specialising recursive functions. For example:

    int Global = 1;
    void recursiveFunc(int *arg) {
      if (*arg &lt; 4) {
        print(*arg);
        recursiveFunc(*arg + 1);
      }
    }
    void main() {
      recursiveFunc(&amp;Global);
    }

After 3 iterations of function specialisation, followed by inlining of the
specialised versions of recursiveFunc, the main function looks like this:

    void main() {
      print(1);
      print(2);
      print(3);
    }

To support this, the following has been added:
- Update the solver and state of the new specialised functions,
- An optimisation to propagate constant stack values after each iteration of
  function specialisation, which is necessary for the next iteration to
  recognise the constant values and trigger.

Specialising recursive functions is (at the moment) controlled by option
-func-specialization-max-iters and is opt-in for compile-time reasons. I.e.,
the default is -func-specialization-max-iters=1, but for the example above we
would need to use -func-specialization-max-iters=3. Future work is to see if we
can increase the default, or improve the cost-model/heuristics to control
compile-times.

Differential Revision: https://reviews.llvm.org/D106426
</pre>
</div>
</content>
</entry>
</feed>
