[PATCH] D96011: [NFC][Analysis] Change struct VecDesc to use ElementCount
Sander de Smalen via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Feb 8 08:15:01 PST 2021
sdesmalen added inline comments.
================
Comment at: llvm/lib/Analysis/TargetLibraryInfo.cpp:1671-1672
+ // same as a scalar.
+ ScalableVF = 0;
+ FixedVF = 1;
if (ScalarF.empty())
----------------
david-arm wrote:
> sdesmalen wrote:
> > Can you define these as ElementCount (and change the interface to take an ElementCount instead of unsigned), and do the initialization before the call to getWidestVF?
> Hi @sdesmalen, I did that initially but then I thought it seemed a bit unnecessary to have them as ElementCounts because the interface clearly defines one as fixed and the other as scalable. I can change them back to ElementCount - it just felt like we were doing redundant extra work that's all.
What is the redundant extra work? The only difference is in where the initialization is done. Now all uses of FixedVF coming from `getWidestVF` have to write explicit ElementCount::getFixed().
Just FYI, I had to solve a similar problem for returning max-VFs in D96025, for which I added a new class `OptionalVFCandidates`, and in a subsequent patch (not yet posted) added a function that generates all power-of-two VFs upto the max-VFs.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D96011/new/
https://reviews.llvm.org/D96011
More information about the llvm-commits
mailing list