[PATCH] D119759: [RISCV] Match shufflevector corresponding to slideup.

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 16 10:07:26 PST 2022


craig.topper added inline comments.


================
Comment at: llvm/lib/Target/RISCV/RISCVISelLowering.cpp:2545
   assert(Rotation != 0 && "Failed to locate a viable rotation!");
-  assert((Lo || Hi) && "Failed to find a rotated input vector!");
-
-  // Make sure we've found a value for both halves.
-  if (!Lo || !Hi)
-    return -1;
-
-  V1 = Lo;
-  V2 = Hi;
+  assert((Lo >= 0 || Hi >= 0) && "Failed to find a rotated input vector!");
 
----------------
khchen wrote:
> If I understand code correctly, the `Lo` and `Hi` could be either 0 or 1, why do we need to check `>=0` for them?
> same question for line 2649 and 2651.
They start as -1 and they won't always be overwritten to 0 or 1.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D119759



More information about the llvm-commits mailing list