[all-commits] [llvm/llvm-project] b78b26: [TTI] Add costing for vp.strided.load and vp.strid...

Philip Reames via All-commits all-commits at lists.llvm.org
Fri Feb 2 09:17:19 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: b78b264518e0f341d99a4291cbf24134c7536f6d
      https://github.com/llvm/llvm-project/commit/b78b264518e0f341d99a4291cbf24134c7536f6d
  Author: Philip Reames <preames at rivosinc.com>
  Date:   2024-02-02 (Fri, 02 Feb 2024)

  Changed paths:
    M llvm/include/llvm/CodeGen/BasicTTIImpl.h
    M llvm/test/Analysis/CostModel/RISCV/gep.ll
    M llvm/test/Analysis/CostModel/RISCV/rvv-intrinsics.ll

  Log Message:
  -----------
  [TTI] Add costing for vp.strided.load and vp.strided.store (#80360)

The primary motivation of this patch is to add testing infrastructure
atop the recently landed 8ad14b6d90121d2d0687a3a7f6f6c6f2b34c4aa7, so
that we can separate the costing aspects of strided memory operations
from the SLP implementation details.

I want to be clear that I am *not* proposing that we use the
vp.strided.* forms as our canonical IR representation. I'm merely using
them as a testing vehicle to exercise the costing machinery. The
canonical IR form remains a masked.gather or masked.scatter. I do want
to explore adding a non-vp strided load/store intrinsic, but that's a
separate line of work.

There is one costing change included in this. As I wrote my test, I
discovered that the default implementation was scalarized (if invoked
via generic routines such as getInstructionCost), and when adding the
call into the strided specific costing discovered that we hadn't modeled
the fallback to scalarization properly in the initial patch. After
fixing that, there is a minor difference in scalarization cost reported
for the unaligned case but I believe that to be uninteresting.

For the record, I did confirm that vp.strided.store is lowered to a
strided store on RISCV. :)




More information about the All-commits mailing list