[PATCH] D91718: [LV] Legalize scalable VF hints
Sander de Smalen via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Nov 24 09:41:39 PST 2020
sdesmalen added inline comments.
================
Comment at: llvm/lib/Transforms/Vectorize/LoopVectorize.cpp:5375
+
+ unsigned FixedVF = PowerOf2Floor(MaxSafeRegisterWidth / WidestType);
+ // If scalable, scale VF by vscale before checking if it's safe.
----------------
nit: `MaxSafeElements`?
================
Comment at: llvm/lib/Transforms/Vectorize/LoopVectorize.cpp:5377
+ // If scalable, scale VF by vscale before checking if it's safe.
+ ElementCount MaxSafeVF =
+ UserVF.isScalable()
----------------
Instead of returning an Optional<ElementCount>, I'd prefer the code here to just clamp to MaxFixedVF,
in this order:
* first try to see if it can use the requested scalable VF.
* if not, then try to see if it can use the requested VF with vscale = 1 (i.e. fixed width)
* if not, then try if it can use a clamped fixed VF.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D91718/new/
https://reviews.llvm.org/D91718
More information about the llvm-commits
mailing list