[all-commits] [llvm/llvm-project] 1a6744: [ARM] Add larger than legal ICmp costs

David Green via All-commits all-commits at lists.llvm.org
Thu Feb 18 03:42:45 PST 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 1a6744e3dc671d92662c94a77bbae50a6a34d316
      https://github.com/llvm/llvm-project/commit/1a6744e3dc671d92662c94a77bbae50a6a34d316
  Author: David Green <david.green at arm.com>
  Date:   2021-02-18 (Thu, 18 Feb 2021)

  Changed paths:
    M llvm/lib/Target/ARM/ARMTargetTransformInfo.cpp
    M llvm/test/Analysis/CostModel/ARM/arith-overflow.ll
    M llvm/test/Analysis/CostModel/ARM/intrinsic-cost-kinds.ll
    M llvm/test/Analysis/CostModel/ARM/mve-cmp.ll
    M llvm/test/Analysis/CostModel/ARM/reduce-smax.ll
    M llvm/test/Analysis/CostModel/ARM/reduce-smin.ll
    M llvm/test/Analysis/CostModel/ARM/reduce-umax.ll
    M llvm/test/Analysis/CostModel/ARM/reduce-umin.ll
    M llvm/test/CodeGen/ARM/vselect_imax.ll
    M llvm/test/Transforms/LoopVectorize/ARM/mve-icmpcost.ll

  Log Message:
  -----------
  [ARM] Add larger than legal ICmp costs

A v8i32 compare will produce a v8i1 predicate, but during codegen the
v8i32 will be split into two v4i32, potentially requiring two v4i1
predicates to be merged into a single v8i1. Because this merging of two
v4i1's into a v8i1 is very expensive, we need to make the cost of the
compare equally high.

This patch adds the cost of that to ARMTTIImpl::getCmpSelInstrCost.
Because we don't know whether the user of the predicate can be split,
and the cost model is mostly pre-instruction, we may be pessimistic but
that should only be for larger and legal types. This also adds min/max
detection to the costmodel where it can be detected, to keep those in
line with the cost of simple min/max instructions. Otherwise for the
most part, costs that were already expensive have become more expensive.

Differential Revision: https://reviews.llvm.org/D96692




More information about the All-commits mailing list