@@ -4227,8 +4227,9 @@ BasicBlock::CleanUpValueMaps()
4227
4227
{
4228
4228
FOREACH_SLISTBASE_ENTRY_EDITING (GlobHashBucket, bucket, &thisTable->table [i], iter)
4229
4229
{
4230
- bool isSymUpwardExposed = upwardExposedUses->Test (bucket.value ->m_id ) || upwardExposedFields->Test (bucket.value ->m_id );
4231
- if (!isSymUpwardExposed && symsInCallSequence.Test (bucket.value ->m_id ))
4230
+ Sym * sym = bucket.value ;
4231
+ bool isSymUpwardExposed = upwardExposedUses->Test (sym->m_id ) || upwardExposedFields->Test (sym->m_id );
4232
+ if (!isSymUpwardExposed && symsInCallSequence.Test (sym->m_id ))
4232
4233
{
4233
4234
// Don't remove/shrink sym-value pair if the sym is referenced in callSequence even if the sym is dead according to backward data flow.
4234
4235
// This is possible in some edge cases that an infinite loop is involved when evaluating parameter for a function (between StartCall and Call),
@@ -4241,22 +4242,22 @@ BasicBlock::CleanUpValueMaps()
4241
4242
// Make sure symbol was created before backward pass.
4242
4243
// If symbols isn't upward exposed, mark it as dead.
4243
4244
// If a symbol was copy-prop'd in a loop prepass, the upwardExposedUses info could be wrong. So wait until we are out of the loop before clearing it.
4244
- if ((SymID)bucket.value ->m_id <= this ->globOptData .globOpt ->maxInitialSymID && !isSymUpwardExposed
4245
- && (!isInLoop || !this ->globOptData .globOpt ->prePassCopyPropSym ->Test (bucket.value ->m_id )))
4245
+ bool isSymFieldPRESymStore = isInLoop && this ->loop ->fieldPRESymStores ->Test (sym->m_id );
4246
+ if ((SymID)sym->m_id <= this ->globOptData .globOpt ->maxInitialSymID && !isSymUpwardExposed && !isSymFieldPRESymStore
4247
+ && (!isInLoop || !this ->globOptData .globOpt ->prePassCopyPropSym ->Test (sym->m_id )))
4246
4248
{
4247
4249
Value *val = bucket.element ;
4248
4250
ValueInfo *valueInfo = val->GetValueInfo ();
4249
4251
4250
- Sym * sym = bucket.value ;
4251
4252
Sym *symStore = valueInfo->GetSymStore ();
4252
4253
4253
- if (symStore && symStore == bucket. value )
4254
+ if (symStore && symStore == sym )
4254
4255
{
4255
4256
// Keep constants around, as we don't know if there will be further uses
4256
4257
if (!bucket.element ->GetValueInfo ()->IsVarConstant () && !bucket.element ->GetValueInfo ()->HasIntConstantValue ())
4257
4258
{
4258
4259
// Symbol may still be a copy-prop candidate. Wait before deleting it.
4259
- deadSymsBv.Set (bucket. value ->m_id );
4260
+ deadSymsBv.Set (sym ->m_id );
4260
4261
4261
4262
// Make sure the type sym is added to the dead syms vector as well, because type syms are
4262
4263
// created in backward pass and so their symIds > maxInitialSymID.
@@ -4287,8 +4288,6 @@ BasicBlock::CleanUpValueMaps()
4287
4288
}
4288
4289
else
4289
4290
{
4290
- Sym * sym = bucket.value ;
4291
-
4292
4291
if (sym->IsPropertySym () && !this ->globOptData .liveFields ->Test (sym->m_id ))
4293
4292
{
4294
4293
// Remove propertySyms which are not live anymore.
@@ -4306,7 +4305,7 @@ BasicBlock::CleanUpValueMaps()
4306
4305
4307
4306
Sym *symStore = valueInfo->GetSymStore ();
4308
4307
4309
- if (symStore && symStore != bucket. value )
4308
+ if (symStore && symStore != sym )
4310
4309
{
4311
4310
keepAliveSymsBv.Set (symStore->m_id );
4312
4311
if (symStore->IsStackSym () && symStore->AsStackSym ()->HasObjectTypeSym ())
0 commit comments