[PATCH] D97470: [CostModel] Align the cost model for intrinsics for scalable/fixed-width vectors.

David Sherwood via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 3 01:51:13 PST 2021


david-arm accepted this revision.
david-arm added a comment.
This revision is now accepted and ready to land.

LGTM!



================
Comment at: llvm/include/llvm/CodeGen/BasicTTIImpl.h:1346
     unsigned ScalarizationCost = std::numeric_limits<unsigned>::max();
-    if (RetVF.isVector()) {
+    if (RetVF.isVector() && !RetVF.isScalable()) {
       ScalarizationCost = 0;
----------------
nit: Could you just use `RetVF.isFixedLengthVector()` instead here?


================
Comment at: llvm/include/llvm/CodeGen/BasicTTIImpl.h:1392
+      // Scalable vectors cannot be scalarized, so return Invalid.
+      if (isa<ScalableVectorType>(RetTy) ||
+          any_of(Tys, [](const Type *Ty) { return isa<ScalableVectorType>(Ty); }))
----------------
nit: Could you address the formatting issues?


================
Comment at: llvm/include/llvm/CodeGen/BasicTTIImpl.h:1809
+      if (isa<ScalableVectorType>(RetTy) ||
+          any_of(Tys, [](const Type *Ty) { return isa<ScalableVectorType>(Ty); }))
+        return InstructionCost::getInvalid();
----------------
nit: Formatting issues


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D97470



More information about the llvm-commits mailing list