[PATCH] D101945: [LV] Add -scalable-vectorization=<option> flag.

Paul Walker via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 12 09:48:03 PDT 2021


paulwalker-arm added inline comments.


================
Comment at: llvm/include/llvm/Transforms/Vectorize/LoopVectorizationLegality.h:99-100
 
+  enum ScalableForceKind : unsigned {
+    SK_Undefined = UINT_MAX, ///< Not selected.
+    SK_Disabled = 0,         ///< Disables vectorization with scalable vectors.
----------------
paulwalker-arm wrote:
> Given the way the code is written, for example `isScalableVectorizationPreferred()` and the comments attached to the enum values I think the patch will be simpler if the enum names reflected their intent.  For example:
> ```
> Unspecified,
> FixedOnly,
> PreferFixed,
> PreferScalable
> ```
It looks weird to have two `Kind`'s that have different definition/handling for `Undefined`.


================
Comment at: llvm/include/llvm/Transforms/Vectorize/LoopVectorizationLegality.h:99-108
+  enum ScalableForceKind : unsigned {
+    SK_Undefined = UINT_MAX, ///< Not selected.
+    SK_Disabled = 0,         ///< Disables vectorization with scalable vectors.
+    SK_Preferred = 1, ///< Like SK_Enabled, but favoring scalable vectors when
+                      ///  the cost-model is inconclusive. This is the default
+                      ///  (1) when the hint is enabled through a pragma.
+    SK_Enabled = 2,   ///< Vectorize loops using scalable vectors or fixed-width
----------------
Given the way the code is written, for example `isScalableVectorizationPreferred()` and the comments attached to the enum values I think the patch will be simpler if the enum names reflected their intent.  For example:
```
Unspecified,
FixedOnly,
PreferFixed,
PreferScalable
```


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D101945



More information about the llvm-commits mailing list