[PATCH] D109417: Cost model for VPMemory operations on PowerPC.
Bardia Mahjour via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Nov 26 11:51:34 PST 2021
bmahjour added inline comments.
================
Comment at: llvm/lib/Target/PowerPC/PPCTargetTransformInfo.cpp:1434
+ NumElems * BaseT::getMemoryOpCost(Opcode, SrcVTy->getScalarType(),
+ Alignment, AddressSpace, CostKind);
+ assert(ScalarMemOpInstrCost.isValid() && "Expected valid instruction cost");
----------------
RolandF wrote:
> The scalar loads have scalar type results. I assume if the code is being vectorized and the function of a vector load is being replaced, the results have to go in a vector. I think there is some insert cost here.
The call to `getScalarizationOverhead` is supposed to account for insert vs extract cost (notice we pass `IsLoad` vs `!isLoad` to indicate whether we need insert or extract cost respectively).
There is an existing function, `getCommonMaskedMemoryOpCost()` which computes cost in a very similar manor and is called by `getMaskedMemoryOpCost()`. I'm thinking of replacing lines 1412-1437 with a call to that function instead. Any thoughts @RolandF ?
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D109417/new/
https://reviews.llvm.org/D109417
More information about the llvm-commits
mailing list