[llvm] [ConstantFolding] Add constant folding for scalable vector interleave intrinsics. (PR #168668)

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 19 09:55:04 PST 2025


================
@@ -51,6 +51,22 @@ define <8 x i32> @fold_vector_interleave2() {
   ret <8 x i32> %1
 }
 
+define <vscale x 8 x i32> @fold_scalable_vector_interleave2() {
+; CHECK-LABEL: define <vscale x 8 x i32> @fold_scalable_vector_interleave2() {
+; CHECK-NEXT:    ret <vscale x 8 x i32> zeroinitializer
+;
+  %1 = call <vscale x 8 x i32> @llvm.vector.interleave2.nxv8i32(<vscale x 4 x i32> zeroinitializer, <vscale x 4 x i32> zeroinitializer)
+  ret <vscale x 8 x i32> %1
+}
+
+define <vscale x 8 x i32> @fold_scalable_vector_interleave2_splat() {
----------------
topperc wrote:

Is it possible to create a scalable vector constant that isn't a splat? Or are you asking for non-constant non-splat?

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


More information about the llvm-commits mailing list