[PATCH] D130374: [Passes] add a tail-call-elim pass near the end of the opt pipeline

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 26 07:46:59 PDT 2022


spatel added a comment.

In D130374#3679550 <https://reviews.llvm.org/D130374#3679550>, @hiraditya wrote:

> In D130374#3675677 <https://reviews.llvm.org/D130374#3675677>, @vdsered wrote:
>
>> Just JFYI :)
>> Yes, probably not worth it
>
> that is interesting. do we know why?

Based on this data: 
https://llvm-compile-time-tracker.com/compare.php?from=95f4ca7f5db623bacc2e34548d39fe5b28d47bad&to=bfb9b8e075ee32197157ccaf0c301122ca9b81af&stat=instructions

This patch (adding a late round of TCE) caused a ~0.06% compile-time regression for a -O3 build (less for the LTO variants). So the value of splitting the pass as proposed in D60031 <https://reviews.llvm.org/D60031> depends on whether we think it's worth trying to save some (unknown?) fraction of the 0.06%.
We decided to push this for the known codegen wins, but someone can still revive the pass-splitting patch if it seems worthwhile.

One more note that I failed to mention while updating all of those clang tests: the reason those tests did not show "tail" before is because we only ran TCE with -O{2/3/s/z}, not -O1. This patch enabled TCE for all -O levels. I don't know the history/motivation for not including TCE at -O1 before, but it did not seem worth excluding based on compile-time cost. If there's another reason, we can add that limitation to the late invocation too (and it should cause most/all of the clang test diffs to revert).


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D130374/new/

https://reviews.llvm.org/D130374



More information about the llvm-commits mailing list