[llvm] [LangRef] Cap maximum value of vscale at 2^31-1. (PR #144607)
Paul Walker via llvm-commits
llvm-commits at lists.llvm.org
Wed Jun 18 10:22:14 PDT 2025
paulwalker-arm wrote:
> > I'm sure restricting the range of vscale will have other benefits but that feels like an independent change and we already have mechanisms to achieve this via vscale_range (and range?) attributes.
>
> I think this is a case of false generality. We could explore alternate options here, but this patch has the major advantage of being _simple_. We can come back and revisit this (even reverse it) if needed, but I see no reason not to go with the simple answer for the moment.
I'm not suggesting we do any actual work, only that the restriction should be specified in terms of the runtime vector length and not about `vscale`. I think this would actually be less work and easier to walk back because with the current `vscale` suggestion the next obvious step is to update `getVScaleRange()` to implement the new requirement, whereas with my suggestion there's no actual change to any part of the IR.
For context, this PR is in response to https://github.com/llvm/llvm-project/pull/143532 albeit it has no real bearing because in that PR I'm simply saying that in order to use the helper functions you commit to the result type being big enough. If you cannot commit to that then you should do the scaling explicitly.
https://github.com/llvm/llvm-project/pull/144607
More information about the llvm-commits
mailing list