@@ -20,7 +20,7 @@ class VPBuilder {
20
20
// Explicit vector length parameter
21
21
Value * ExplicitVectorLength;
22
22
// Compile-time vector length
23
- int StaticVectorLength;
23
+ ElementCount StaticVectorLength;
24
24
25
25
// get a valid mask/evl argument for the current predication contet
26
26
Value& RequestPred ();
@@ -31,7 +31,7 @@ class VPBuilder {
31
31
: Builder(_builder)
32
32
, Mask(nullptr )
33
33
, ExplicitVectorLength(nullptr )
34
- , StaticVectorLength(- 1 )
34
+ , StaticVectorLength(0 , false )
35
35
{}
36
36
37
37
Module & getModule () const ;
@@ -41,9 +41,23 @@ class VPBuilder {
41
41
VectorType& getVectorType (Type &ElementTy);
42
42
43
43
// Predication context tracker
44
- VPBuilder& setMask (Value * _Mask) { Mask = _Mask; return *this ; }
45
- VPBuilder& setEVL (Value * _ExplicitVectorLength) { ExplicitVectorLength = _ExplicitVectorLength; return *this ; }
46
- VPBuilder& setStaticVL (int VLen) { StaticVectorLength = VLen; return *this ; }
44
+ VPBuilder &setMask (Value *_Mask) {
45
+ Mask = _Mask;
46
+ return *this ;
47
+ }
48
+ VPBuilder &setEVL (Value *_ExplicitVectorLength) {
49
+ ExplicitVectorLength = _ExplicitVectorLength;
50
+ return *this ;
51
+ }
52
+ VPBuilder &setStaticVL (unsigned FixedVL) {
53
+ StaticVectorLength = ElementCount (FixedVL, false );
54
+ return *this ;
55
+ }
56
+ VPBuilder &setStaticVL (ElementCount ScalableVL) {
57
+ assert (false && " TODO implement vscale handling" );
58
+ StaticVectorLength = ScalableVL;
59
+ return *this ;
60
+ }
47
61
48
62
// Create a map-vectorized copy of the instruction \p Inst with the underlying IRBuilder instance.
49
63
// This operation may return nullptr if the instruction could not be vectorized.
0 commit comments