[PATCH] D129150: [DAG] Canonicalize non-inlane shuffle -> AND if all non-inlane referenced elements are known zero

Dave Green via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 13 12:23:55 PDT 2022


dmgreen added inline comments.


================
Comment at: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:22679-22680
+      for (int I = 0; I != (int)NumElts; ++I)
+        if (Mask[I] == I)
+          AndMask[I] = AllOnesElt;
+
----------------
Why is a zero mask better than an undef mask for undef shuffle mask elements?


================
Comment at: llvm/lib/Target/AArch64/AArch64ISelLowering.cpp:11814
 
+bool AArch64TargetLowering::isVectorClearMaskLegal(ArrayRef<int> M,
+                                                   EVT VT) const {
----------------
Is this saying that `MOV #0 + LegalShuffle` is always better than `create mask + and`? I think that sounds OK, so long as it doesn't destroy any BIC patterns.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D129150/new/

https://reviews.llvm.org/D129150



More information about the llvm-commits mailing list