Skip to content

cmd/compile: skip zero'ing order array for select statements #40399

@mdempsky

Description

@mdempsky

The compiler zero-initializes the order array before calling selectgo, but the runtime ends up overwriting almost all of it anyway. We could probably shave a few instructions from call sites if selectgo took full responsibility for initializing the array.

I think this is just a matter of adding a pollorder[0] = 0 assignment in selectgo, and removing the nod(OAS, order, nil) assignment in cmd/compile/internal/gc/select.go.

See also #40397 (comment).

/cc @cuonglm

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrozenDueToAgeNeedsFixThe path to resolution is known, but the work has not been done.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions