[llvm] [X86] matchUnaryShuffle - only prefer VZEXT_MOVL to VPMOVZX if it will fold away (PR #207031)

Phoebe Wang via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 1 21:00:05 PDT 2026


================
@@ -40265,10 +40262,9 @@ static bool matchUnaryShuffle(MVT MaskVT, ArrayRef<int> Mask,
   }
 
   // Match against a VZEXT_MOVL instruction, SSE1 only supports 32-bits (MOVSS).
-  if (((MaskEltSize == 32) || (MaskEltSize == 64 && Subtarget.hasSSE2()) ||
-       (MaskEltSize == 16 && Subtarget.hasFP16())) &&
-      isUndefOrEqual(Mask[0], 0) &&
-      isUndefOrZeroInRange(Mask, 1, NumMaskElts - 1)) {
+  if (Mask[0] == 0 && isUndefOrZeroInRange(Mask, 1, NumMaskElts - 1) &&
----------------
phoebewang wrote:

Why `Mask[0]` cannot be undef?

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


More information about the llvm-commits mailing list