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

Philip Reames via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 19 10:43:47 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() {
----------------
preames wrote:

You're right, so just do the case with two different splats.  

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


More information about the llvm-commits mailing list