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

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Jul 24 17:31:56 PDT 2022


spatel added a comment.

In D130374#3672840 <https://reviews.llvm.org/D130374#3672840>, @nikic wrote:

>> 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
>
> This is probably because tail calls short-circuit some AA modref queries, so we probably end up saving time there.
>
> I'm fine with adding an extra TailCallElim pass -- I guess my main uncertainty here is where exactly it should be positioned. Might it make more sense to move it to the optimization rather than simplification pipeline? As our interest here is in tail markers rather than actual TCE, this seems like a typical late optimization pass. (On that note, we could also run only the markTails portion of TCE, but given the overall small compile-time impact, doing the split is probably not worth the effort?)

Yes, this should be run later. I saw MemCpyOpt and figured that was the last place we'd create memset/memcpy calls like in the bug reports, but there's no reason to run TailCallElim that early.


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

https://reviews.llvm.org/D130374



More information about the llvm-commits mailing list