[llvm] [X86] Attempt to canonicalize vXf64 SHUFPD shuffle masks with undef elts to improve further folding (PR #116419)

Simon Pilgrim via llvm-commits llvm-commits at lists.llvm.org
Sat Nov 16 08:07:20 PST 2024


================
@@ -9926,6 +9926,42 @@ static SDValue getV4X86ShuffleImm8ForMask(ArrayRef<int> Mask, const SDLoc &DL,
   return DAG.getTargetConstant(getV4X86ShuffleImm(Mask), DL, MVT::i8);
 }
 
+// Canonicalize SHUFPD mask to improve chances of further folding.
----------------
RKSimon wrote:

There are a number of test cases which now further fold to `VBLENDPD/S` (allowing commutation yay!) or `VUNPCK?PD` - the only further fold that leads to an actual instruction reduction so far is the `add_v4f64_024u_135u_reverse` test in vector-shuffle-256-v4.ll

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


More information about the llvm-commits mailing list