Skip to content

Improve modelling of AsyncResumedDef store in value numbering #131576

Closed

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

  1. added
    area-CodeGen-coreclrCLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI
    on Jul 30, 2026
  2. dotnet-policy-service commented on Jul 30, 2026

    @dotnet-policy-service
    Contributor

    Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch
    See info in area-owners.md if you want to be subscribed.

  3. added this to the 12.0.0 milestone on Jul 30, 2026
  4. removed
    untriagedNew issue has not been triaged by the area owner
    on Jul 30, 2026
  5. added 2 commits that reference this issue on Aug 17, 2026
    256cb81
    29a964c
  6. locked and limited conversation to collaborators on Oct 11, 2026
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