[PATCH] D113294: [IR] Remove unbounded as possible value for vscale_range minimum

Cullen Rhodes via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Dec 3 09:43:06 PST 2021


c-rhodes added inline comments.


================
Comment at: clang/lib/Basic/Targets/AArch64.cpp:476-484
+  assert(LangOpts.VScaleMin && "vscale min must be greater than 0!");
+
+  if (LangOpts.VScaleMax)
     return std::pair<unsigned, unsigned>(LangOpts.VScaleMin,
                                          LangOpts.VScaleMax);
+
   if (hasFeature("sve"))
----------------
paulwalker-arm wrote:
> This looks like a change of behaviour to me.  Previously the command line flags would override the "sve" default but now that only happens when the user specifies a maximum value.  That means the interface can no longer be used to force truly width agnostic values.
> This looks like a change of behaviour to me.  Previously the command line flags would override the "sve" default but now that only happens when the user specifies a maximum value.  That means the interface can no longer be used to force truly width agnostic values.

I think the issue here is the default of 1 for min would always trigger `if (LangOpts.VScaleMin || LangOpts.VScaleMax)` overriding the SVE default. Perhaps the default can be removed from the driver option and handled here, i.e.

```
if (LangOpts.VScaleMin || LangOpts.VScaleMax)
    return std::pair<unsigned, unsigned>(LangOpts.VScaleMin ? LangOpts.VScaleMin : 1,
                                         LangOpts.VScaleMax);
```




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

https://reviews.llvm.org/D113294



More information about the cfe-commits mailing list