search for: elementcount

Displaying 20 results from an estimated 27 matches for "elementcount".

2020 Nov 11
3
An update on scalable vectors in LLVM
...ort closely, people will undoubtably have seen some of the changes in the code-base around this, so here is a brief update to give this effort some wider visibility. This email is structured as follows: * Regular Sync-up meetings * Changes made to represent scalable vectors in the C++ codebase * ElementCount and VectorType type hierarchy * Migrating to TypeSize * StackOffset * What works for scalable vectors today? * What’s next? * Concluding * Acknowledgements Regular Sync-up meetings: ========================= Adding scalable vector support to Clang and LLVM is an effort spanning multiple peop...
2020 Mar 09
8
[RFC] Refactor class hierarchy of VectorType in the IR
...ave been written <n x ty> in IR, where n is a fixed number of elements known at compile time, and ty is some type. Scalable vectors are written <vscale x n x ty> where vscale is a runtime constant value. A new function has been added to VectorType (defined in llvm/IR/DerivedTypes.h), getElementCount(), that returns an ElementCount, which is defined as such in llvm/Support/TypeSize.h: class ElementCount { public: unsigned Min; bool Scalable; ... } Min is the minimum number of elements in the vector (the "n" in <vscale x n x ty>), and Scalabl...
2016 Nov 04
2
[RFC] Supporting ARM's SVE in LLVM
...cs of the target. # Types ## Overview: ## IR Class Changes: To represent a vector of unknown length a scaling property is added to the `VectorType` class whose element count becomes an unknown multiple of a known minimum element count. To be specific `unsigned NumElements` is replaced by `class ElementCount` with its two members: * `unsigned Min`: the minimum number of elements. * `bool Scalable`: is the element count an unknown multiple of `Min`? For non-scalable vectors (`Scalable=false`) the scale is assumed to be one and thus `Min` becomes identical to the original `NumElements` property. This...
2020 May 21
3
[RFC] Refactor class hierarchy of VectorType in the IR
...all the places where it says VectorType, and change it to say FixedVectorType. > … by having the VectorType type semantically repurposed out from under them. The documented semantics of VectorType prior to my RFC were that it is a generalization of all vector types. The VectorType contains an ElementCount, which is a pair of (bool, unsigned). If the bool is true, then the return value of getNumElements() is the minimum number of vector elements. If the bool is false, then it is the actual number of elements. My RFC has not changed these semantics. It will eventually delete a function that has been p...
2020 Apr 22
2
[Update][RFC] Refactor class hierarchy of VectorType in the IR
...e. It is now impossible to construct a base VectorType. Additionally, FixedVectorType::get and ScalableVectorType::get functions have been added that allow you to directly construct these types. I have also added an overload of VectorType::get that takes a type, and a vector. This overload calls getElementCount() on the given vector and uses that to construct a new VectorType. This is a convenience helper for the cases where "I want a vector with the same shape as this other vector, but a different element type." Calls to VectorType::get(SomeTy, SomeVTy->getNumElements()) that try to implemen...
2010 Feb 10
0
[LLVMdev] [patch] Union Types - work in progress
...() && !ElemTy->isLabelTy() && + !ElemTy->isMetadataTy() && !isa<FunctionType>(ElemTy); +} Isn't there a better predicate somewhere? +LLVMTypeRef LLVMUnionTypeInContext(LLVMContextRef C, LLVMTypeRef *ElementTypes, + unsigned ElementCount) { + std::vector<const Type*> Tys; + for (LLVMTypeRef *I = ElementTypes, + indentation of unsigned and use smallvector. +/// ParseUnionType +/// TypeRec +/// ::= 'union' '{' '}' +/// ::= 'union' '{' TypeRec (',' TypeRec)* '}...
2016 Nov 29
2
[RFC] Supporting ARM's SVE in LLVM
On Mon, Nov 28, 2016 at 7:37 AM Paul Walker via llvm-dev < llvm-dev at lists.llvm.org> wrote: > That is my intention with the stepvector patch ( > https://reviews.llvm.org/D27105). You can see that the interface is > common but for non-scalable vectors the result is its equivalent > ConstantVector. Once an agreed form is available > LoopVectorize::getStepVector can be
2020 May 05
2
[Update][RFC] Refactor class hierarchy of VectorType in the IR
...e. It is now impossible to construct a base VectorType. Additionally, FixedVectorType::get and ScalableVectorType::get functions have been added that allow you to directly construct these types. I have also added an overload of VectorType::get that takes a type, and a vector. This overload calls getElementCount() on the given vector and uses that to construct a new VectorType. This is a convenience helper for the cases where “I want a vector with the same shape as this other vector, but a different element type.” Calls to VectorType::get(SomeTy, SomeVTy->getNumElements()) that try to implement this cas...
2017 Jun 01
4
[RFC][SVE] Supporting Scalable Vector Architectures in LLVM IR (take 2)
...rs doesn't need to know the exact length, but does need to know relative lengths -- e.g. get a vector with the same number of elements but a different element type, or with half or double the number of elements. In order to allow code to transparently support scalable vectors, we introduce an `ElementCount` class with two members: - `unsigned Min`: the minimum number of elements. - `bool Scalable`: is the element count an unknown multiple of `Min`? For non-scalable vectors (``Scalable=false``) the scale is considered to be equal to one and thus `Min` represents the exact number of elements in the v...
2010 Feb 10
3
[LLVMdev] [patch] Union Types - work in progress
ping... On Thu, Jan 28, 2010 at 12:25 PM, Talin <viridia at gmail.com> wrote: > OK here's a new version of the patch - and the unions.ll test actually > passes :) > > On Mon, Jan 18, 2010 at 1:40 PM, Chris Lattner <clattner at apple.com> wrote: > >> >> On Jan 16, 2010, at 11:15 AM, Talin wrote: >> >> OK here's the patch for real this
2017 Jun 07
2
[RFC][SVE] Supporting Scalable Vector Architectures in LLVM IR (take 2)
...but does need to know relative lengths -- e.g. get >> a vector with the same number of elements but a different element type, or with >> half or double the number of elements. >> >> In order to allow code to transparently support scalable vectors, we introduce >> an `ElementCount` class with two members: >> >> - `unsigned Min`: the minimum number of elements. >> - `bool Scalable`: is the element count an unknown multiple of `Min`? >> >> For non-scalable vectors (``Scalable=false``) the scale is considered to be >> equal to one and thus...
2018 Jun 05
14
[RFC][SVE] Supporting SIMD instruction sets with variable vector lengths
...rs doesn't need to know the exact length, but does need to know relative lengths -- e.g. get a vector with the same number of elements but a different element type, or with half or double the number of elements. In order to allow code to transparently support scalable vectors, we introduce an `ElementCount` class with two members: - `unsigned Min`: the minimum number of elements. - `bool Scalable`: is the element count an unknown multiple of `Min`? For non-scalable vectors (``Scalable=false``) the scale is considered to be equal to one and thus `Min` represents the exact number of elements in the v...
2019 May 24
2
[RFC][SVE] Supporting SIMD instruction sets with variable vector lengths
...he exact length, but > does need to know relative lengths -- e.g. get a vector with the same number of > elements but a different element type, or with half or double the number of > elements. > > In order to allow code to transparently support scalable vectors, we introduce > an `ElementCount` class with two members: > > - `unsigned Min`: the minimum number of elements. > - `bool Scalable`: is the element count an unknown multiple of `Min`? > > For non-scalable vectors (``Scalable=false``) the scale is considered to be > equal to one and thus `Min` represents the exact...
2018 Jul 30
5
[RFC][SVE] Supporting SIMD instruction sets with variable vector lengths
...e exact length, but > does need to know relative lengths -- e.g. get a vector with the same number of > elements but a different element type, or with half or double the number of > elements. > > In order to allow code to transparently support scalable vectors, we introduce > an `ElementCount` class with two members: > > - `unsigned Min`: the minimum number of elements. > - `bool Scalable`: is the element count an unknown multiple of `Min`? > > For non-scalable vectors (``Scalable=false``) the scale is considered to be > equal to one and thus `Min` represents the exa...
2019 May 24
2
[EXT] Re: [RFC][SVE] Supporting SIMD instruction sets with variable vector lengths
...rs doesn't need to know the exact length, but does need to know relative lengths -- e.g. get a vector with the same number of elements but a different element type, or with half or double the number of elements. In order to allow code to transparently support scalable vectors, we introduce an `ElementCount` class with two members: - `unsigned Min`: the minimum number of elements. - `bool Scalable`: is the element count an unknown multiple of `Min`? For non-scalable vectors (``Scalable=false``) the scale is considered to be equal to one and thus `Min` represents the exact number of elements in the v...
2019 May 27
2
[EXT] Re: [RFC][SVE] Supporting SIMD instruction sets with variable vector lengths
...rs doesn't need to know the exact length, but does need to know relative lengths -- e.g. get a vector with the same number of elements but a different element type, or with half or double the number of elements. In order to allow code to transparently support scalable vectors, we introduce an `ElementCount` class with two members: - `unsigned Min`: the minimum number of elements. - `bool Scalable`: is the element count an unknown multiple of `Min`? For non-scalable vectors (``Scalable=false``) the scale is considered to be equal to one and thus `Min` represents the exact number of elements in the v...
2019 Jun 03
2
[EXT] Re: [RFC][SVE] Supporting SIMD instruction sets with variable vector lengths
...he exact length, but > does need to know relative lengths -- e.g. get a vector with the same number of > elements but a different element type, or with half or double the number of > elements. > > In order to allow code to transparently support scalable vectors, we introduce > an `ElementCount` class with two members: > > - `unsigned Min`: the minimum number of elements. > - `bool Scalable`: is the element count an unknown multiple of `Min`? > > For non-scalable vectors (``Scalable=false``) the scale is considered to be > equal to one and thus `Min` represents the exact...
2018 Jul 30
7
[RFC][SVE] Supporting SIMD instruction sets with variable vector lengths
...a vector with the > same number of > > elements but a different element type, or with half or double > the number of > > elements. > > > > In order to allow code to transparently support scalable > vectors, we introduce > > an `ElementCount` class with two members: > > > > - `unsigned Min`: the minimum number of elements. > > - `bool Scalable`: is the element count an unknown multiple of > `Min`? > > > > For non-scalable vectors (``Scalable=false``) the scale is > conside...
2010 Feb 12
1
[LLVMdev] [patch] Union Types - work in progress
...isMetadataTy() && !isa<FunctionType>(ElemTy); > +} > > Isn't there a better predicate somewhere? > Apparently there is now. Done. > > +LLVMTypeRef LLVMUnionTypeInContext(LLVMContextRef C, LLVMTypeRef > *ElementTypes, > + unsigned ElementCount) { > + std::vector<const Type*> Tys; > + for (LLVMTypeRef *I = ElementTypes, > + > > indentation of unsigned and use smallvector. > > Done. > > +/// ParseUnionType > +/// TypeRec > +/// ::= 'union' '{' '}' > +/// ::= ...
2020 Nov 17
0
[Proposal] Introducing the concept of invalid costs to the IR cost model
...o the IR cost model Hi David, This would be a very useful upgrade to the cost model. One thing I want to add is that we need to be mindful of the cases where the cost is proportional (or inversely proportional) to the VF, for instance in the LoopVectorizationCostModel::selectVectorizationFactor(ElementCount MaxVF), there is a point where expected cost is divided by the VF. I believe there are other places where the instruction cost is dependent on the actual number of elements in the vector. While this is not a problem for fixed vectors, for scalable vectors we need to account for the vscale component...