[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 05:14:21 PST 2020


mstorsjo added a comment.

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

> In D90554#2393351 <https://reviews.llvm.org/D90554#2393351>, @mstorsjo wrote:
>
>> I noticed a change in behaviour due to this commit - on ARM and AArch64, for cases involving the log2 intrinsic - previously, llvm was able to evaluate a big pile of code to deduce that a comparison involving log2 always is true, but after this change, it no longer does that. Is that something you want to have a look into, or is that expected? I wouldn't classify it as a bug in itself, as the code does what it's supposed to, it just optimizes differently than before.
>
> If you can reduce a test that shows the difference, that would be great. I'm not sure which pass was responsible for the optimization. 
> My first guess is that we should create a basic class size-cost exception for all of the scalar intrinsics that correspond to libm functions.

I'm not sure how to reduce it meaningfully, but it's at least observable with https://martin.st/temp/celp_math-preproc.c and https://martin.st/temp/celp_math.ll. With the bitcode, `opt -O3 -S celp_math.ll` used to produce a no-op main() function before this change, same goes if compiling the preprocessed C code with `clang -target aarch64-w64-mingw32 -c -O3 celp_math-preproc.c -fno-math-errno`.


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