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

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 1 16:47:40 PDT 2022


efriedma added a comment.

In D132623#3756786 <https://reviews.llvm.org/D132623#3756786>, @probinson wrote:

> In D132623#3756345 <https://reviews.llvm.org/D132623#3756345>, @nikic wrote:
>
>> Why does this need to use an attribute rather than querying optimization level in the backend?
>
> The attribute already exists and is used in several places.  This patch just adds the attribute to more functions.

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.


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