Skip to content

cmd/compile/ssa: mark if { panic } blocks as unlikely #11451

Closed
@josharian

Description

@josharian

Given a block like

if condition {
  // basic block
  panic(...)
}

we should mark condition as unlikely. Unlikely to make a huge difference, but many things in the runtime have guards like this; we may as well help the branch predictor. Inspired by CL 11541.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions