[llvm] [VectorCombine] Fold vector.interleave2 with two constant splats (PR #125144)

Min-Yih Hsu via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 31 10:29:01 PST 2025


================
@@ -3145,6 +3146,45 @@ bool VectorCombine::foldInsExtVectorToShuffle(Instruction &I) {
   return true;
 }
 
+bool VectorCombine::foldInterleaveIntrinsics(Instruction &I) {
+  // If we're interleaving 2 constant splats, for instance `<vscale x 8 x i32>
+  // <splat of 666>` and `<vscale x 8 x i32> <splat of 777>`, we can create a
+  // larger splat
+  // `<vscale x 8 x i64> <splat of ((777 << 32) | 666)>` first before casting it
+  // back into `<vscale x 16 x i32>`.
+  using namespace PatternMatch;
----------------
mshockwave wrote:

Fixed.

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


More information about the llvm-commits mailing list