[SCEV] Constant expansion cost at minsize
authorSam Parker <sam.parker@arm.com>
Mon, 7 Sep 2020 11:06:02 +0000 (12:06 +0100)
committerSam Parker <sam.parker@arm.com>
Thu, 10 Sep 2020 07:21:11 +0000 (08:21 +0100)
commit0bdf8c9127244127aef3620a8ef1eb4d2be57dad
tree43a8dea4023a9ee360883b6ec8b52c7be5495097
parent1919b650523282c550536b6b72eb4713cd6712f4
[SCEV] Constant expansion cost at minsize

As code size is the only thing we care about at minsize, query the
cost of materialising immediates when calculating the cost of a SCEV
expansion. We also modify the CostKind to TCK_CodeSize for minsize,
instead of RecipThroughput.

Differential Revision: https://reviews.llvm.org/D76434
llvm/lib/Transforms/Utils/ScalarEvolutionExpander.cpp
llvm/test/Transforms/IndVarSimplify/ARM/indvar-unroll-imm-cost.ll