[PATCH] D137904: [RISCV] Provide a isOneSourceVECTOR_SHUFFLE function. NFC.

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Nov 13 16:16:42 PST 2022


craig.topper added inline comments.


================
Comment at: llvm/lib/Target/RISCV/RISCVISelLowering.cpp:2768
                            const RISCVSubtarget &Subtarget) {
-  if (!N1.isUndef()) {
-    // Both input must be extracts.
-    if (N0.getOpcode() != ISD::EXTRACT_SUBVECTOR ||
-        N1.getOpcode() != ISD::EXTRACT_SUBVECTOR)
-      return false;
-
-    // Extracting from the same source.
-    SDValue Src = N0.getOperand(0);
-    if (Src != N1.getOperand(0))
-      return false;
-
-    // Make sure N0 and N1 are continuous.
-    if (N0.getConstantOperandVal(1) != 0 ||
-        N1.getConstantOperandVal(1) != Mask.size())
-      return false;
-  }
+  if (!isOneSourceVECTOR_SHUFFLE(N0, N1, Mask))
+    return false;
----------------
Should isVnsrlShuffle return the SDValue returned from isOneSourceVECTOR_SHUFFLE? Looks like the caller makes an assumption about how to find the source.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D137904



More information about the llvm-commits mailing list