We want to allow splat value transforms to improve PR44588 and related bugs:
https://bugs.llvm.org/show_bug.cgi?id=44588
...but to do that, we need to know if values are splatted from the same, specific index (lane) rather than splatted from an arbitrary index.
We can improve the undef handling with 1-liner follow-ups because the Constant API optionally allow undefs now.
This change will cause a conflict with the planned update of shufflevector's mask in D72467, but that's a small fix-up depending on if it lands first or second.
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.