[PATCH] D124218: [LoadStoreVectorizer] Consider if operation is faster than before

Stanislav Mekhanoshin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 18 10:30:21 PDT 2022


rampitec added inline comments.


================
Comment at: llvm/lib/Transforms/Vectorize/LoadStoreVectorizer.cpp:1086
+      accessIsMisaligned(EltSzInBytes, AS, Alignment, FastBefore);
+      if (FastBefore > Fast)
+        return false;
----------------
foad wrote:
> rampitec wrote:
> > foad wrote:
> > > It is not at all clear to me whether it makes sense to compare `FastBefore` with `Fast` directly, or whether one of them needs to be multiplied by `ChainSize`. Especially since the definition of `Fast` is target-specific.
> > I thought about this, but 'fast' is not an actual memory transfer speed like Gb/s, it is a speed rank. Defining real memory speed will be hard to do, especially given alignment considerations. I do not think this is additive like a cost. It can be compared, but hardly added or multiplied. More so when an ultimate 'slow' is still zero.
> I still don't understand how generic code can meaningfully compare, for example, one load with speed rank 42 vs two loads with speed rank 99. Are you supposed to ignore the number of loads completely, and just compare the speed rank numbers?
Yes, the rank behaves more like a throughput. It is not precisely a throughput because nobody can guarantee it, but a similar concept.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D124218/new/

https://reviews.llvm.org/D124218



More information about the llvm-commits mailing list