[PATCH] D94501: [SelectionDAG] Support scalable-vector splats in more cases

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 21 11:31:31 PST 2021


craig.topper added inline comments.


================
Comment at: llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp:5035
+  } else if (VT.isScalableVector()) {
+    Shift = DAG.getSplatVector(ShVT, dl, Shifts[0]);
+    Factor = DAG.getSplatVector(VT, dl, Factors[0]);
----------------
Is there only one element in Shifts and Factors? If I'm reading matchUnaryPredicate right it will only see the single operand of the SPLAT_VECTOR so only call BuildSDIVPattern once?


================
Comment at: llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp:5316
   SDValue One = DAG.getConstant(1, dl, VT);
-  SDValue IsOne = DAG.getSetCC(dl, VT, N1, One, ISD::SETEQ);
+  SDValue IsOne = DAG.getSetCC(dl, SetCCVT, N1, One, ISD::SETEQ);
   return DAG.getSelect(dl, VT, IsOne, N0, Q);
----------------
I'm a bit surprised this didn't affect AVX512 on X86.


================
Comment at: llvm/test/CodeGen/AArch64/sve-int-arith-imm.ll:598
 ; CHECK-NEXT: ret
   %elt = insertelement <vscale x 16 x i8> undef, i8 8, i32 0
   %splat = shufflevector <vscale x 16 x i8> %elt, <vscale x 16 x i8> undef, <vscale x 16 x i32> zeroinitializer
----------------
Is this test trying to test an oversized shift amount or just a bad choice of constant? I'm leaning towards bad constant choice the lsl tests don't have this issue?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D94501



More information about the llvm-commits mailing list