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

Paul Walker via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 6 09:35:15 PST 2023


paulwalker-arm 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.

For today perhaps it's best I extend the textual support to fallback to `ConstantVector::getSplat()` rather than erroring and defer the decision whether to deprecate non-immediate scalable vector constants.  My guess is it'll take some time to migrate the immediate cases anyway.

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


More information about the llvm-commits mailing list