llvm-project/llvm/lib/Passes
Sanjay Patel bfb9b8e075 [Passes] add a tail-call-elim pass near the end of the opt pipeline
We call tail-call-elim near the beginning of the pipeline,
but that is too early to annotate calls that get added later.

In the motivating case from issue #47852, the missing 'tail'
on memset leads to sub-optimal codegen.

I experimented with removing the early instance of
tail-call-elim instead of just adding another pass, but that
appears to be slightly worse for compile-time:
+0.15% vs. +0.08% time.
"tailcall" shows adding the pass; "tailcall2" shows moving
the pass to later, then adding the original early pass back
(so 1596886802 is functionally equivalent to 180b0439dc ):
https://llvm-compile-time-tracker.com/index.php?config=NewPM-O3&stat=instructions&remote=rotateright

Note that there was an effort to split the tail call functionality
into 2 passes - that could help reduce compile-time if we find
that this change costs more in compile-time than expected based
on the preliminary testing:
D60031

Differential Revision: https://reviews.llvm.org/D130374
2022-07-25 15:25:47 -04:00
..
CMakeLists.txt [NFC] Split up PassBuilder.cpp 2021-09-15 15:30:39 -07:00
OptimizationLevel.cpp [NFC] Split up PassBuilder.cpp 2021-09-15 15:30:39 -07:00
PassBuilder.cpp Revert "[Coroutines] Only do symmetric transfer if optimization is on" 2022-06-27 10:54:56 +08:00
PassBuilderBindings.cpp [Coroutines] Run coroutine passes by default 2021-07-15 14:33:40 +08:00
PassBuilderPipelines.cpp [Passes] add a tail-call-elim pass near the end of the opt pipeline 2022-07-25 15:25:47 -04:00
PassPlugin.cpp [NPM] Resolve llvmGetPassPluginInfo to the plugin being loaded 2021-06-30 18:11:28 +01:00
PassRegistry.def Delete 'llvm.asan.globals' for global metadata. 2022-06-27 14:40:40 -07:00
StandardInstrumentations.cpp [Passes] Simplify ChangePrinter names. NFC 2022-07-23 19:32:13 -07:00