[LV] Use VScaleForTuning to fine-tune the cost per lane.
authorSander de Smalen <sander.desmalen@arm.com>
Mon, 8 Nov 2021 15:24:31 +0000 (15:24 +0000)
committerSander de Smalen <sander.desmalen@arm.com>
Mon, 8 Nov 2021 16:59:46 +0000 (16:59 +0000)
commit2829376bb267f3364c1225ffaac8b1b8b5688ed1
tree7f8373060997484b15f5ca356358a22a2e0b2e9d
parent59a4bbe26cfb11aca11f3992f138f86d43acb8c1
[LV] Use VScaleForTuning to fine-tune the cost per lane.

When targeting a specific CPU with scalable vectorization, the knowledge
of that particular CPU's vscale value can be used to tune the cost-model
and make the cost per lane less pessimistic.

If the target implements 'TTI.getVScaleForTuning()', the cost-per-lane
is calculated as:

  Cost / (VScaleForTuning * VF.KnownMinLanes)

Otherwise, it assumes a value of 1 meaning that the behavior
is unchanged and calculated as:

  Cost / VF.KnownMinLanes

Reviewed By: kmclaughlin, david-arm

Differential Revision: https://reviews.llvm.org/D113209
llvm/include/llvm/Analysis/TargetTransformInfo.h
llvm/include/llvm/Analysis/TargetTransformInfoImpl.h
llvm/include/llvm/CodeGen/BasicTTIImpl.h
llvm/lib/Analysis/TargetTransformInfo.cpp
llvm/lib/Target/AArch64/AArch64TargetTransformInfo.h
llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
llvm/test/Transforms/LoopVectorize/AArch64/scalable-vectorization-cost-tuning.ll [new file with mode: 0644]
llvm/test/Transforms/LoopVectorize/AArch64/scalable-vectorization.ll
llvm/test/Transforms/LoopVectorize/AArch64/scalable-vf-hint.ll