[PATCH] D44523: Change calculation of MaxVectorSize
Diego Caballero via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Mar 15 14:49:47 PDT 2018
dcaballe added a comment.
> Would it be possible to add a TTI callback that forces the minimum VF?
This sounds reasonable to me as long as the cost for the minimum VF is still better than the scalar version.
> I think Michael Kuperstein was trying to enable double pumping (could be one year or more ago). I think it's best to dig it up. There may be something usable in there.
Given Krzysztof's experiment, pumping doesn't seem to introduce stability issues in LV. `calculateRegisterUsage` seems to be handling some cost modeling for pumping (not sure if it's enough):
// A lambda that gets the register usage for the given type and VF.
auto GetRegUsage = [&DL, WidestRegister](Type *Ty, unsigned VF) {
if (Ty->isTokenTy())
return 0U;
unsigned TypeSize = DL.getTypeSizeInBits(Ty->getScalarType());
return std::max<unsigned>(1, VF * TypeSize / WidestRegister);
};
Maybe it's just a question of changing `MaxVectorSize` as suggested, and refine the cost modeling, if necessary.
Let's wait for Michael.
Repository:
rL LLVM
https://reviews.llvm.org/D44523
More information about the llvm-commits
mailing list