@@ -132,10 +132,10 @@ class VPLane {
132
132
unsigned Lane;
133
133
134
134
// / Indicates how the Lane should be interpreted, as described above.
135
- Kind LaneKind;
135
+ Kind LaneKind = Kind::First ;
136
136
137
137
public:
138
- VPLane (unsigned Lane) : Lane(Lane), LaneKind(VPLane::Kind::First) {}
138
+ VPLane (unsigned Lane) : Lane(Lane) {}
139
139
VPLane (unsigned Lane, Kind LaneKind) : Lane(Lane), LaneKind(LaneKind) {}
140
140
141
141
static VPLane getFirstLane () { return VPLane (0 , VPLane::Kind::First); }
@@ -161,7 +161,8 @@ class VPLane {
161
161
// / Returns a compile-time known value for the lane index and asserts if the
162
162
// / lane can only be calculated at runtime.
163
163
unsigned getKnownLane () const {
164
- assert (LaneKind == Kind::First);
164
+ assert (LaneKind == Kind::First &&
165
+ " can only get known lane from the beginning" );
165
166
return Lane;
166
167
}
167
168
@@ -179,10 +180,12 @@ class VPLane {
179
180
unsigned mapToCacheIndex (const ElementCount &VF) const {
180
181
switch (LaneKind) {
181
182
case VPLane::Kind::ScalableLast:
182
- assert (VF.isScalable () && Lane < VF.getKnownMinValue ());
183
+ assert (VF.isScalable () && Lane < VF.getKnownMinValue () &&
184
+ " ScalableLast can only be used with scalable VFs" );
183
185
return VF.getKnownMinValue () + Lane;
184
186
default :
185
- assert (Lane < VF.getKnownMinValue ());
187
+ assert (Lane < VF.getKnownMinValue () &&
188
+ " Cannot extract lane larger than VF" );
186
189
return Lane;
187
190
}
188
191
}
0 commit comments