Skip to content

Improve modelling of AsyncResumedDef store in value numbering #131576

Description

@jakobbotsch

In VN we set the value of all call defs to unknown here:

// If the call generates any definitions, for example because it uses "return buffer", then VN the local
// as well.
auto visitDef = [=](const LocalDef& def) {
ValueNumPair storeValue;
storeValue.SetBoth(vnStore->VNForExpr(compCurBB, lvaGetDesc(def.Def->AsLclVarCommon())->TypeGet()));
fgValueNumberLocalStore(call, def.Def, def.Offset, def.Size, storeValue);
return GenTree::VisitResult::Continue;
};
call->VisitLocalDefs(this, visitDef);

However, in two scenarios we do know the value of AsyncResumedDef:

  1. If this is an always-suspending call, then the value will be 1 after
  2. If this is dominated by an always-suspending call (i.e. resumed is already known to be constant 1) then the value will also be 1 after

We should be able to model this.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-CodeGen-coreclrCLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions