[PATCH] D128665: [AArch64] Make nxv1i1 types a legal type for SVE.

Paul Walker via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 30 10:16:05 PDT 2022


paulwalker-arm added a comment.

Sorry for the incremental review.  This was not intentional, just how my code review time worked out for this patch.



================
Comment at: llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp:6664-6667
+  unsigned InNumElts = InVT.getVectorMinNumElements();
+  unsigned WidenNumElts = NVT.getVectorMinNumElements();
   if (WidenNumElts > InNumElts && WidenNumElts % InNumElts == 0) {
     unsigned NumConcat = WidenNumElts / InNumElts;
----------------
A few weeks back I extended TypeSize.h to include methods that allow us to handle such cases without resorting to `getVectorMinNumElements()`. See `hasKnownScalarFactor` and `getKnownScalarFactor`. The `>` code can use `NVT.bitsGT(InVT)`.


================
Comment at: llvm/lib/Target/AArch64/AArch64ISelLowering.cpp:10484
+  if (VT == MVT::nxv1i1)
+    return getPUNPKLO(DAG, DL,
+                      DAG.getNode(ISD::INTRINSIC_WO_CHAIN, DL, MVT::nxv2i1, ID,
----------------
Rather than using `PUNPKLO` directly can you use `ISD::EXTRACT_SUBVECTOR`?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D128665



More information about the llvm-commits mailing list