@@ -132,10 +132,10 @@ class VPLane {
132132 unsigned Lane;
133133
134134 // / Indicates how the Lane should be interpreted, as described above.
135- Kind LaneKind;
135+ Kind LaneKind = Kind::First ;
136136
137137public:
138- VPLane (unsigned Lane) : Lane(Lane), LaneKind(VPLane::Kind::First) {}
138+ VPLane (unsigned Lane) : Lane(Lane) {}
139139 VPLane (unsigned Lane, Kind LaneKind) : Lane(Lane), LaneKind(LaneKind) {}
140140
141141 static VPLane getFirstLane () { return VPLane (0 , VPLane::Kind::First); }
@@ -161,7 +161,8 @@ class VPLane {
161161 // / Returns a compile-time known value for the lane index and asserts if the
162162 // / lane can only be calculated at runtime.
163163 unsigned getKnownLane () const {
164- assert (LaneKind == Kind::First);
164+ assert (LaneKind == Kind::First &&
165+ " can only get known lane from the beginning" );
165166 return Lane;
166167 }
167168
@@ -179,10 +180,12 @@ class VPLane {
179180 unsigned mapToCacheIndex (const ElementCount &VF) const {
180181 switch (LaneKind) {
181182 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" );
183185 return VF.getKnownMinValue () + Lane;
184186 default :
185- assert (Lane < VF.getKnownMinValue ());
187+ assert (Lane < VF.getKnownMinValue () &&
188+ " Cannot extract lane larger than VF" );
186189 return Lane;
187190 }
188191 }
0 commit comments