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

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 6 08:31:43 PST 2023


nikic wrote:

My main question here is whether this should be limited to immediates, or work with everything that `ConstantVector::getSplat()` supports. That is, is there any reason why this syntax supports `splat (i32 123)` but not for example `splat (ptr @g)` or `splat (i64 ptrtoint (ptr @g to i64))`?

Ultimately we will need some way to represent all splats we can currently represent -- I assume that the `splat (ptr @g)` case for scalable vectors is going to be covered by `getelementptr i8, ptr @g, <vscale x N x i64> zeroinitializer`. (Are there any other tricky cases?)

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


More information about the llvm-commits mailing list