[PATCH] D98245: [ARM] Tone down the MVE scalarization overhead

Dave Green via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 9 03:09:53 PST 2021


dmgreen created this revision.
dmgreen added reviewers: SjoerdMeijer, samtebbs, NickGuy, efriedma, ostannard, simon_tatham.
Herald added subscribers: danielkiss, hiraditya, kristof.beyls.
dmgreen requested review of this revision.
Herald added a project: LLVM.

The scalarization overhead was set deliberately high for MVE, whilst the codegen was new. It helps protect us against the negative ramifications of mixing scalar and vector instructions. This decreases that, especially for floating point where the cost of extracting/inserting lane elements can be low. For integer the cost is still fairly high due to the cross-register-bank copy, but is not longer n^2 in the length of the vector.

In general, this will decrease the cost of scalarizing floats and long integer vectors. i64 increase in cost, having a high cost before and after this patch. For floats this allows up to start doing things like vectorizing fdiv instructions, even if they are scalarized.

It requires some fixups from D98243 <https://reviews.llvm.org/D98243> and D98210 <https://reviews.llvm.org/D98210> to adjust other inefficiencies that this exposes.


https://reviews.llvm.org/D98245

Files:
  llvm/lib/Target/ARM/ARMTargetTransformInfo.cpp
  llvm/test/Analysis/CostModel/ARM/arith-overflow.ll
  llvm/test/Analysis/CostModel/ARM/arith-ssat.ll
  llvm/test/Analysis/CostModel/ARM/arith-usat.ll
  llvm/test/Analysis/CostModel/ARM/arith.ll
  llvm/test/Analysis/CostModel/ARM/cast.ll
  llvm/test/Analysis/CostModel/ARM/cast_ldst.ll
  llvm/test/Analysis/CostModel/ARM/cmps.ll
  llvm/test/Analysis/CostModel/ARM/divrem.ll
  llvm/test/Analysis/CostModel/ARM/fparith.ll
  llvm/test/Analysis/CostModel/ARM/intrinsic-cost-kinds.ll
  llvm/test/Analysis/CostModel/ARM/load_store.ll
  llvm/test/Analysis/CostModel/ARM/mve-abs.ll
  llvm/test/Analysis/CostModel/ARM/mve-cmp.ll
  llvm/test/Analysis/CostModel/ARM/mve-gather-scatter-cost.ll
  llvm/test/Analysis/CostModel/ARM/mve-minmax.ll
  llvm/test/Analysis/CostModel/ARM/mve-vecreduce-add.ll
  llvm/test/Analysis/CostModel/ARM/reduce-smax.ll
  llvm/test/Analysis/CostModel/ARM/reduce-smin.ll
  llvm/test/Analysis/CostModel/ARM/reduce-umax.ll
  llvm/test/Analysis/CostModel/ARM/reduce-umin.ll
  llvm/test/Analysis/CostModel/ARM/select.ll
  llvm/test/Analysis/CostModel/ARM/shuffle.ll
  llvm/test/Transforms/LoopVectorize/ARM/mve-icmpcost.ll
  llvm/test/Transforms/LoopVectorize/ARM/mve-interleaved-cost.ll
  llvm/test/Transforms/LoopVectorize/ARM/mve-saddsatcost.ll
  llvm/test/Transforms/LoopVectorize/ARM/pointer_iv.ll
  llvm/test/Transforms/LoopVectorize/ARM/tail-folding-not-allowed.ll
  llvm/test/Transforms/PhaseOrdering/ARM/mve-floatreduce.ll



More information about the llvm-commits mailing list