[PATCH] D90554: [CostModel] remove cost-kind predicate for intrinsics in basic TTI implementation

Martin Storsjö via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 13 12:04:56 PST 2020


mstorsjo added a comment.

In D90554#2394783 <https://reviews.llvm.org/D90554#2394783>, @spatel wrote:

> Thanks for the test. The difference with `@main` is in the unroller:
> COMPLETELY UNROLLING loop %do.body6 with trip count 11!
>
> And with that, it seems to vanish. Interestingly, the optimization was only happening with -O3 (not -O2) even before this patch because we set the unroll threshold higher at -O3.
> I will try to reduce the example and adjust the cost model to make that work again.

Ah, interesting, that explains why this seemingly unrelated change had such an effect.

FWIW I don't have much of a need for the specific case to be optimized the way it was before - I just happened to notice because I had a log2() function implementation that gave approximate results and failed this testcase, but it had been succeeding for ages due to clang optimizing it out altogether before.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D90554



More information about the llvm-commits mailing list