[all-commits] [llvm/llvm-project] aadc9d: [RISCV] Cost model for scalable reductions

Philip Reames via All-commits all-commits at lists.llvm.org
Mon Jun 27 12:44:54 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: aadc9d26a3618a47f317417fbd903b2bcd232e98
      https://github.com/llvm/llvm-project/commit/aadc9d26a3618a47f317417fbd903b2bcd232e98
  Author: Philip Reames <preames at rivosinc.com>
  Date:   2022-06-27 (Mon, 27 Jun 2022)

  Changed paths:
    M llvm/lib/Target/RISCV/RISCVTargetTransformInfo.cpp
    M llvm/lib/Target/RISCV/RISCVTargetTransformInfo.h
    M llvm/test/Analysis/CostModel/RISCV/reduce-scalable-fp.ll
    M llvm/test/Analysis/CostModel/RISCV/reduce-scalable-int.ll

  Log Message:
  -----------
  [RISCV] Cost model for scalable reductions

This extends the existing cost model for reductions for scalable vectors.

The existing cost model assumes that reductions are roughly logarithmic in cost for unordered variants and linear for ordered ones. This change keeps that same basic model, and extends it out to the maximum number of elements a scalable vector could possibly have.

This results in costs which aren't terribly high for unordered reductions, but are for ordered ones. This seems about right; we want to strongly bias away from using scalable ordered reductions if the cost might be linear in VL.

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




More information about the All-commits mailing list