[CostModel] make default size cost for libcalls small (again)
authorSanjay Patel <spatel@rotateright.com>
Sat, 14 Nov 2020 13:04:14 +0000 (08:04 -0500)
committerSanjay Patel <spatel@rotateright.com>
Sat, 14 Nov 2020 13:15:35 +0000 (08:15 -0500)
commit8ec7ea3ddce7379e13e8dfb4a5260a6d2004aa1c
tree7b19618d01ca0e812fed1d3afe71dc1374380e7a
parentdf09f825995b10da03f148133c119f52c94fd6e4
[CostModel] make default size cost for libcalls small (again)

This was changed recently with D90554 / f7eac51b9b3f
...because we had a regression testing blindspot for intrinsics
that are expected to be lowered to libcalls.

In general, we want the *size* cost for a scalar call to be cheap
even if the other costs are expensive - we expect it to just be
a branch with some optional stack manipulation.

It is likely that we will want to carve out some
exceptions/overrides to this rule as follow-up patches for
calls that have some general and/or target-specific difference
to the expected lowering.

This was noticed as a regression in unrolling, so we have a test
for that now along with a couple of direct cost model tests.

If the assumed scalarization costs for the oversized vector
calls are not realistic, that would be another follow-up
refinement of the cost models.
llvm/include/llvm/CodeGen/BasicTTIImpl.h
llvm/test/Analysis/CostModel/ARM/intrinsic-cost-kinds.ll
llvm/test/Analysis/CostModel/X86/intrinsic-cost-kinds.ll
llvm/test/Transforms/LoopUnroll/AArch64/thresholdO3-cost-model.ll