[PATCH] D121109: [AArch64] Add cost model for llvm.get.active.lane.mask intrinsic
David Sherwood via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Mar 8 01:09:52 PST 2022
david-arm added inline comments.
================
Comment at: llvm/lib/Target/AArch64/AArch64TargetTransformInfo.cpp:234
+ // This should be a single instruction.
+ if (!TLI->shouldExpandGetActiveLaneMask(ResVT, ArgType))
+ return 1;
----------------
dmgreen wrote:
> sdesmalen wrote:
> > Can the default case (i.e. when `shouldExpandGetActiveLaneMask = true`) be added to BasicTTIImpl?
> > Then in the target's TTI, you only need to handle the case where the intrinsic is not expanded.
> Does this need to be here? Or could it be part of the target independent code - assuming the cost is 1 if it is not expanded?
That's a good idea. One thing that makes me uncertain of that is that I can't call the usual `TLI->getTypeLegalizationCost` function to get the value type because for NEON the legalised type is transformed from v4i1 -> v4i32, etc. This then changes the behaviour of `shouldExpandGetActiveLaneMask`. That's why I only call `TLI->getValueType` here. If there is precedence for doing this in BasicTTIImpl then I'm happy to move it there.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D121109/new/
https://reviews.llvm.org/D121109
More information about the llvm-commits
mailing list