[PATCH] D102515: [CostModel] Return an invalid cost for memory ops with unsupported types

Sander de Smalen via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon May 17 13:42:19 PDT 2021


sdesmalen added inline comments.


================
Comment at: llvm/include/llvm/Analysis/TargetTransformInfo.h:1324
+  /// \returns True if it is legal to vectorize the given element type.
+  bool isLegalToVectorizeElementType(Type *Ty, bool VectorIsScalable) const;
+
----------------
Does it ever make sense to call this function with `VectorIsScalable=false` given that fixed-width vectors can fall back on scalarization?
If not, should this then become: `isElementTypeLegalForScalableVector(Type *Ty)` ?


================
Comment at: llvm/lib/Target/AArch64/AArch64TargetTransformInfo.cpp:1524-1530
+  if (Ty->isIntegerTy(1))
+    return true;
+
+  if (VectorIsScalable)
+    return isLegalElementTypeForSVE(Ty);
+
+  return true;
----------------
nit:

  if (!VectorIsScalable)
    return true;
  return Ty->isIntegerTy(1) || isLegalElementTypeForSVE(Ty);


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

https://reviews.llvm.org/D102515



More information about the llvm-commits mailing list