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

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 22 13:03:10 PDT 2022


nikic added a comment.

> 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?)


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

https://reviews.llvm.org/D130374



More information about the llvm-commits mailing list