[PATCH] D157322: [VPlan] Initial modeling of runtime VF * UF as VPValue.

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 25 13:01:42 PDT 2023


fhahn marked 3 inline comments as done.
fhahn added inline comments.
Herald added a subscriber: sunshaoce.


================
Comment at: llvm/lib/Transforms/Vectorize/VPlan.h:2469
 
+  /// Represents the runtime VF * UF of the vector loop region.
+  VPValue RuntimeVFxUF;
----------------
nikolaypanchenko wrote:
> might be better to clarify that it's loop invariant VPValue.
> With @ABataev patch in, we may followup to unify `EVL` and `RuntimeVFxUF`. Does it sound reasonable ? 
> might be better to clarify that it's loop invariant VPValue.

Updated, thanks!

> With @ABataev patch in, we may followup to unify EVL and RuntimeVFxUF. Does it sound reasonable ?


Sounds good. I think another suggestion/option that @Ayal had was to keep the canonical induction increment fixed (incrementing by a variable value would make it non-canonical) to control the loop and use EVL to only control the lanes accessed by (vector) recipes.


================
Comment at: llvm/lib/Transforms/Vectorize/VPlan.h:2543
+  /// Returns runtime VF * UF for the vector loop region.
+  VPValue &getRuntimeVFxUF() { return RuntimeVFxUF; }
+
----------------
ABataev wrote:
> fhahn wrote:
> > ABataev wrote:
> > > const member function
> > Unfortunately this causes problems with various users which expect non-const return value.
> But can you return non-const return value but using const function?
> Like
> ```
> VPValue &getRuntimeVFxUF() const {return RuntimeVFxUF;}
> ```
Unfortunately this yields the following error as this would return a mutable reference to a member of a const pointer.

```
llvm/lib/Transforms/Vectorize/VPlan.h:2560:45: error: binding reference of type 'VPValue' to value of type 'const VPValue' drops 'const' qualifier
  VPValue &getRuntimeVFxUF() const { return RuntimeVFxUF; }
                                            ^~~~~~~~~~~~
```


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D157322



More information about the llvm-commits mailing list