File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
llvm/lib/Transforms/Vectorize Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -311,12 +311,12 @@ struct VPTransformState {
311
311
void set (VPValue *Def, Value *V, const VPIteration &Instance) {
312
312
auto Iter = Data.PerPartScalars .insert ({Def, {}});
313
313
auto &PerPartVec = Iter.first ->second ;
314
- while (PerPartVec.size () <= Instance.Part )
315
- PerPartVec.emplace_back ( );
314
+ if (PerPartVec.size () <= Instance.Part )
315
+ PerPartVec.resize (Instance. Part + 1 );
316
316
auto &Scalars = PerPartVec[Instance.Part ];
317
317
unsigned CacheIdx = Instance.Lane .mapToCacheIndex (VF);
318
- while (Scalars.size () <= CacheIdx)
319
- Scalars.push_back ( nullptr );
318
+ if (Scalars.size () <= CacheIdx)
319
+ Scalars.resize (CacheIdx + 1 );
320
320
assert (!Scalars[CacheIdx] && " should overwrite existing value" );
321
321
Scalars[CacheIdx] = V;
322
322
}
You can’t perform that action at this time.
0 commit comments