[llvm] [LLVM][IR] Add textual shorthand for specifying constant vector splats. (PR #74620)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 7 06:13:56 PST 2023


nikic wrote:

> It depends how far down the rabbit hole we want to go. From a textual point of view the change looks easy but given the goal is to move away from `ConstantExpr` I'd have to ask what the value is to supporting `splat (ptr @g)` for scalable vectors? We don't support scalable vector globals so the only use is within a function where non-constant IR should be sufficient? I'm generally not that familiar with the benefits and the existing scalable vector support comes from it being a logical extension of existing code rather than having a massive amount of thought behind it.

My general thought here was that this is necessary for "closure", so that the `ConstantVector::getSplat()` can safely be used with any `Constant *` and we don't get edge case assertion failures where scalable vectors are combined with constant expressions. But after looking at some of the uses of `ConstantVector::getSplat()`, I'm coming around to the idea that we probably don't need this.

https://github.com/llvm/llvm-project/pull/74620


More information about the llvm-commits mailing list