[llvm-dev] [RFC] Vector Predication

Simon Moll via llvm-dev llvm-dev at lists.llvm.org
Tue Feb 5 04:26:52 PST 2019

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