[all-commits] [llvm/llvm-project] fc865c: [RISCV][CostModel] VPIntrinsics have same cost as ...
Michael Maitland via All-commits
all-commits at lists.llvm.org
Thu Oct 5 07:10:17 PDT 2023
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: fc865c20345860f394448c228054beafc22a1d4d
https://github.com/llvm/llvm-project/commit/fc865c20345860f394448c228054beafc22a1d4d
Author: Michael Maitland <michaeltmaitland at gmail.com>
Date: 2023-10-05 (Thu, 05 Oct 2023)
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:
-----------
[RISCV][CostModel] VPIntrinsics have same cost as their non-vp counterparts (#67178)
On RISCV, only a few VPIntrinsics have their cost modeled by the
VectorIntrinsicCostTable. Even so, none of those entries consider LMUL.
All other VPIntrinsics do not have meaningful modeling.
This patch models the cost of a VPIntrinsic as the cost of its non-VP
counterpart. It is possible that the VP Intrinsic is cheaper than the
non-VP
version depending on VL. On RISCV, this may be due two reasons (if the
instruction is part of a loop):
1. A smaller VL can be used on the last iteration of the loop.
2. The VP instruction may avoid a scalar remainder loop.
I have left this as a TODO since I think this change puts us on the
right path of modeling the cost of a VPInstruction, and it isn't
entirely clear to me how much of a discount we should give to a
known VL<VLMAX or what to do when VL is unknown at compile time.
More information about the All-commits
mailing list