[llvm] [IR] Split vector.splice into vector.splice.left and vector.splice.right (PR #170796)

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 8 08:31:47 PST 2025


================
@@ -20729,30 +20729,66 @@ Arguments:
 All arguments must be vectors of the same type whereby their logical
 concatenation matches the result type.
 
-'``llvm.vector.splice``' Intrinsic
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+'``llvm.vector.splice.left``' Intrinsic
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+Syntax:
+"""""""
+This is an overloaded intrinsic.
+
+::
+
+      declare <2 x double> @llvm.vector.splice.left.v2f64(<2 x double> %vec1, <2 x double> %vec2, i32 %imm)
+      declare <vscale x 4 x i32> @llvm.vector.splice.left.nxv4i32(<vscale x 4 x i32> %vec1, <vscale x 4 x i32> %vec2, i32 %imm)
+
+Overview:
+"""""""""
+
+The '``llvm.vector.splice.left.*``' intrinsics construct a vector by
+concatenating two vectors together, shifting the elements left by ``imm``, and
+extracting the lower half.
+
+These intrinsics work for both fixed and scalable vectors. While this intrinsic
+supports all vector types the recommended way to express this operation for
+fixed-width vectors is still to use a shufflevector, as that may allow for more
+optimization opportunities.
+
+For example:
+
+.. code-block:: text
+
+ llvm.vector.splice.left(<A,B,C,D>, <E,F,G,H>, 1);
----------------
topperc wrote:

So left here means the opposite of what it means for rotate and funnel shift since the vector elements are written 0, 1, 2, 3, ..., n-1 but bits are written n-1, n-2, ..., 2, 1, 0?

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


More information about the llvm-commits mailing list