[PATCH] D73549: [Analysis] add optional index parameter to isSplatValue()

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 30 13:06:52 PST 2020


efriedma added inline comments.


================
Comment at: llvm/include/llvm/Analysis/VectorUtils.h:305
+/// elements (potentially including undefined elements). If an index value is
+/// specified, require that the splat is from that element of the vector.
 /// This may be more powerful than the related getSplatValue() because it is
----------------
This description is really misleading.

The simple definition of a "splat", if we didn't have poison or undef, would simply be that we have to prove that each element is equal.  (The index wouldn't be relevant.)

If you add poison, it becomes something like "Each element is either poisoned or equal to every other non-poisoned element.  In addition, if an index is specified, either every element of the vector is poisoned, or the element at that index is not poisoned".

I haven't tried to concisely extend that to include undef, but the description should still look roughly like that.


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

https://reviews.llvm.org/D73549





More information about the llvm-commits mailing list