[PATCH] D132623: [CodeGen] Disable tail calls at -O0/-O1

Paul Robinson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 7 13:24:56 PDT 2022


probinson added a comment.

In D132623#3772858 <https://reviews.llvm.org/D132623#3772858>, @rnk wrote:

> In D132623#3765673 <https://reviews.llvm.org/D132623#3765673>, @efriedma wrote:
>
>> Well, really, this is querying the optimizations level in the backend; that's what the code in TargetPassConfig::addISelPrepare does.  The reason it feels weird to me (and probably to @nikic) is that it's querying it in a slightly weird place.  If we're going to check it in the backend anyway, we might as well just check it in the same place we'd check for the attribute, instead of adding the attribute, then checking for it a couple passes later.
>
> I see, sorry, I didn't read the patch closely. I think we should set this in the frontend, or check the optimization level in the codegenerator. Using an extra pass seems heavyweight.

I think we are better off not having two ways to spell "don't tail-call here" (attribute & opt-level) that have to be checked every place we might tail-call.  So, if doing it in the pass is weird, it should be set in the frontend.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D132623



More information about the llvm-commits mailing list