search for: getelementcount

Displaying 20 results from an estimated 20 matches for "getelementcount".

2020 Apr 22
2
[Update][RFC] Refactor class hierarchy of VectorType in the IR
...true. 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...
2020 May 05
2
[Update][RFC] Refactor class hierarchy of VectorType in the IR
...true. 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...
2020 May 22
3
[RFC] Refactor class hierarchy of VectorType in the IR
...all of this work is undone. Every place that has been fixed up to correctly have VectorType be used as a universal vector type will now incorrectly have the fixed width vector type being used as the universal vector type. Since VectorType will inherit from BaseVectorType, it will have inherited the getElementCount(), so the compiler will happily continue to compile this code. However, none of this code will even work with scalable vectors because the bool will always be false. There will be no compile time indication that this is going on, functions will just start mysteriously returning nullptr. Earlier thi...
2020 Mar 09
8
[RFC] Refactor class hierarchy of VectorType in the IR
...s have 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...
2020 May 21
5
[RFC] Refactor class hierarchy of VectorType in the IR
...code to handle scalable vectors correctly. If the call site does not have test coverage with scalable vectors, this test coverage is being added. Even for obviously correct transformations such as `VectorType::get(SomeTy, SomeVecTy->getNumElements())` -> `VectorType::get(SomeTy, SomeVecTy->getElementCount())`, I have been required in code review to provide test coverage. We are taking this seriously. > “Vector” has a traditional and dominant meaning as a fixed-width SIMD type, and the fact that you’ve introduced a generalization doesn’t change that. Clang supports multiple kinds of pointer, but...
2020 May 21
3
[RFC] Refactor class hierarchy of VectorType in the IR
...s have 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 Scalable is true if the vector is scalable (t...
2017 Jun 01
4
[RFC][SVE] Supporting Scalable Vector Architectures in LLVM IR (take 2)
...-scalable vectors (``Scalable=false``) the scale is considered to be equal to one and thus `Min` represents the exact number of elements in the vector. The intent for code working with vectors is to use convenience methods and avoid directly dealing with the number of elements. If needed, calling `getElementCount` on a vector type instead of `getVectorNumElements` can be used to obtain the (potentially scalable) number of elements. Overloaded division and multiplication operators allow an ElementCount instance to be used in much the same manner as an integer for most cases. This mixture of static and runti...
2020 Nov 11
3
An update on scalable vectors in LLVM
...ntCount and VectorType type hierarchy: ------------------------------------------- To represent the number of elements in a vector, the class ElementCount is used to describe N lanes of a fixed-width vector or vscale * N lanes of a scalable vector. Initially, we added the `ElementCount VectorType::getElementCount()` interface alongside `unsigned VectorType::getNumElements()`. In March this year, Christopher Tetreault took on the monumental task to distinguish vector types in the codebase by modifying the type hierarchy for VectorType (http://lists.llvm.org/pipermail/llvm-dev/2020-March/139811.html). Chris...
2020 May 13
4
[llvm-commits@lists.llvm.org: Re: [llvm] 2dea3f1 - [SVE] Add new VectorType subclasses]
Bringing this up on llvm-dev for more general attention. The problem here is two fold: (1) Reuse of enumeration values is just a major no-go. (2) I'm not sure why the existing vector types had to be killed completely. But something clearly has to be done here. This majorly affects e.g. Mesa. Joerg ----- Forwarded message from Joerg Sonnenberger via llvm-commits <llvm-commits at
2018 Jun 05
14
[RFC][SVE] Supporting SIMD instruction sets with variable vector lengths
...-scalable vectors (``Scalable=false``) the scale is considered to be equal to one and thus `Min` represents the exact number of elements in the vector. The intent for code working with vectors is to use convenience methods and avoid directly dealing with the number of elements. If needed, calling `getElementCount` on a vector type instead of `getVectorNumElements` can be used to obtain the (potentially scalable) number of elements. Overloaded division and multiplication operators allow an ElementCount instance to be used in much the same manner as an integer for most cases. This mixture of compile-time and...
2017 Jun 07
2
[RFC][SVE] Supporting Scalable Vector Architectures in LLVM IR (take 2)
...nsidered to be >> equal to one and thus `Min` represents the exact number of elements in the >> vector. >> >> The intent for code working with vectors is to use convenience methods and avoid >> directly dealing with the number of elements. If needed, calling >> `getElementCount` on a vector type instead of `getVectorNumElements` can be used >> to obtain the (potentially scalable) number of elements. Overloaded division and >> multiplication operators allow an ElementCount instance to be used in much the >> same manner as an integer for most cases. >...
2019 May 24
2
[RFC][SVE] Supporting SIMD instruction sets with variable vector lengths
...=false``) the scale is considered to be > equal to one and thus `Min` represents the exact number of elements in the > vector. > > The intent for code working with vectors is to use convenience methods and avoid > directly dealing with the number of elements. If needed, calling > `getElementCount` on a vector type instead of `getVectorNumElements` can be used > to obtain the (potentially scalable) number of elements. Overloaded division and > multiplication operators allow an ElementCount instance to be used in much the > same manner as an integer for most cases. > > This mix...
2018 Jul 30
5
[RFC][SVE] Supporting SIMD instruction sets with variable vector lengths
...false``) the scale is considered to be > equal to one and thus `Min` represents the exact number of elements in the > vector. > > The intent for code working with vectors is to use convenience methods and avoid > directly dealing with the number of elements. If needed, calling > `getElementCount` on a vector type instead of `getVectorNumElements` can be used > to obtain the (potentially scalable) number of elements. Overloaded division and > multiplication operators allow an ElementCount instance to be used in much the > same manner as an integer for most cases. > > This mi...
2019 May 24
2
[EXT] Re: [RFC][SVE] Supporting SIMD instruction sets with variable vector lengths
...-scalable vectors (``Scalable=false``) the scale is considered to be equal to one and thus `Min` represents the exact number of elements in the vector. The intent for code working with vectors is to use convenience methods and avoid directly dealing with the number of elements. If needed, calling `getElementCount` on a vector type instead of `getVectorNumElements` can be used to obtain the (potentially scalable) number of elements. Overloaded division and multiplication operators allow an ElementCount instance to be used in much the same manner as an integer for most cases. This mixture of compile-time and...
2018 Jun 15
2
[RFC][SVE] Supporting SIMD instruction sets with variable vector lengths
...-scalable vectors (``Scalable=false``) the scale is considered to be equal to one and thus `Min` represents the exact number of elements in the vector. The intent for code working with vectors is to use convenience methods and avoid directly dealing with the number of elements. If needed, calling `getElementCount` on a vector type instead of `getVectorNumElements` can be used to obtain the (potentially scalable) number of elements. Overloaded division and multiplication operators allow an ElementCount instance to be used in much the same manner as an integer for most cases. This mixture of compile-time and...
2019 May 27
2
[EXT] Re: [RFC][SVE] Supporting SIMD instruction sets with variable vector lengths
...-scalable vectors (``Scalable=false``) the scale is considered to be equal to one and thus `Min` represents the exact number of elements in the vector. The intent for code working with vectors is to use convenience methods and avoid directly dealing with the number of elements. If needed, calling `getElementCount` on a vector type instead of `getVectorNumElements` can be used to obtain the (potentially scalable) number of elements. Overloaded division and multiplication operators allow an ElementCount instance to be used in much the same manner as an integer for most cases. This mixture of compile-time and...
2019 Jun 03
2
[EXT] Re: [RFC][SVE] Supporting SIMD instruction sets with variable vector lengths
...=false``) the scale is considered to be > equal to one and thus `Min` represents the exact number of elements in the > vector. > > The intent for code working with vectors is to use convenience methods and avoid > directly dealing with the number of elements. If needed, calling > `getElementCount` on a vector type instead of `getVectorNumElements` can be used > to obtain the (potentially scalable) number of elements. Overloaded division and > multiplication operators allow an ElementCount instance to be used in much the > same manner as an integer for most cases. > > This mix...
2018 Jul 30
7
[RFC][SVE] Supporting SIMD instruction sets with variable vector lengths
...hus `Min` represents the exact number of > elements in the > > vector. > > > > The intent for code working with vectors is to use convenience > methods and avoid > > directly dealing with the number of elements. If needed, calling > > `getElementCount` on a vector type instead of > `getVectorNumElements` can be used > > to obtain the (potentially scalable) number of elements. > Overloaded division and > > multiplication operators allow an ElementCount instance to be > used in much the > > same m...
2018 Jul 02
3
[RFC][SVE] Supporting SIMD instruction sets with variable vector lengths
...=false``) the scale is considered to be > equal to one and thus `Min` represents the exact number of elements in the > vector. > > The intent for code working with vectors is to use convenience methods and avoid > directly dealing with the number of elements. If needed, calling > `getElementCount` on a vector type instead of `getVectorNumElements` can be used > to obtain the (potentially scalable) number of elements. Overloaded division and > multiplication operators allow an ElementCount instance to be used in much the > same manner as an integer for most cases. > > This mix...
2016 Nov 04
2
[RFC] Supporting ARM's SVE in LLVM
...between different scalable vector types without knowing their exact length. ## IR Interface: ```cpp static VectorType *get(Type *ELType, ElementCount EC); // Legacy interface whilst code is migrated. static VectorType *get(Type *ElType, unsigned NumEls, bool Scalable=false); ElementCount getElementCount(); bool isScalable(); ``` ## IR Textual Form: The textual IR for vectors becomes: `<[n x] <m> x <type>>` where `type` is the scalar type of each element, `m` corresponds to `Min` and the optional string literal `n x ` signifies `Scalable` is *true* when present, false otherw...