[llvm] [InstCombine] Let shrinkSplatShuffle act on vectors of different lengths (PR #148593)

Luke Lau via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 14 21:52:22 PDT 2025


================
@@ -960,8 +960,8 @@ define <3 x i31> @wide_splat3(<3 x i33> %x) {
 
 define <8 x i8> @wide_lengthening_splat(<4 x i16> %v) {
 ; CHECK-LABEL: @wide_lengthening_splat(
-; CHECK-NEXT:    [[SHUF:%.*]] = shufflevector <4 x i16> [[V:%.*]], <4 x i16> poison, <8 x i32> zeroinitializer
-; CHECK-NEXT:    [[TR:%.*]] = trunc <8 x i16> [[SHUF]] to <8 x i8>
+; CHECK-NEXT:    [[TMP1:%.*]] = trunc <4 x i16> [[V:%.*]] to <4 x i8>
+; CHECK-NEXT:    [[TR:%.*]] = shufflevector <4 x i8> [[TMP1]], <4 x i8> poison, <8 x i32> zeroinitializer
----------------
lukel97 wrote:

Yeah I think we want to restrict it to only when Shuf->getOperand(0) is shorter than Shuf?

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


More information about the llvm-commits mailing list