[llvm-dev] [RFC] Vector Predication

Bruce Hoult via llvm-dev llvm-dev at lists.llvm.org
Tue Feb 5 04:34:29 PST 2019


Yes. If the requested length is less than or equal to the the maximum
length (taking into account element size and VLMul) then the requested
length *must* be returned. Calling setvl with the return value from a
previous setvl with the same vtype is guaranteed to be idempotent.

On Tue, Feb 5, 2019 at 4:26 AM Simon Moll <moll at cs.uni-saarland.de> wrote:
>
> On 2/5/19 12:49 PM, Luke Kenneth Casson Leighton wrote:
> >
> > Basically what I am saying is that the semantics "request an AVL from
> > the hardware and get an ACTUAL number of elements to be processed"
> > really needs to become part of the API.
> >
> Ok. We could add this behavior to the EVL contract with an intrinsic.
>
> %EffectiveVL = llvm.evl.setvl(<scalable vscale x float>, %RequestedAVL)
> where vscale would be interpreted as VLMul on RISC-V.
>
> > the inner workings of AVL are entirely hidden and opaque to the IR.
> > The IR sets the total explicit number of elements, and It Gets Done.
>
> That would still be ok, if the following invariant holds on RVV:
>
> Given that
>
>     %effectivevl = setvl <vty> %reqVL
>
> Will the following invariant hold whenever %avl <= %effectivevl?
>
>     %avl == setvl <vty>, %avl
>
> In that case, we could require the VL parameter to be derived from the
> evl.setvl intrinsic without violating that part of EVL semantics (all
> elements in the range from [0 to VL) will be processed).
>
> - Simon
>
> >
> >
> > --
> > ---
> > crowd-funded eco-conscious hardware: https://www.crowdsupply.com/eoma68
> >
> --
>
> Simon Moll
> Researcher / PhD Student
>
> Compiler Design Lab (Prof. Hack)
> Saarland University, Computer Science
> Building E1.3, Room 4.31
>
> Tel. +49 (0)681 302-57521 : moll at cs.uni-saarland.de
> Fax. +49 (0)681 302-3065  : http://compilers.cs.uni-saarland.de/people/moll
>


More information about the llvm-dev mailing list