Skip to content

Add and test [[assume]] for goto #5

@kammce

Description

@kammce

We'd do this:

  while (true) {
    auto const* instruction_handler = jump_table[*instruction_ptr];
    instruction_ptr++;
    [[assume(instruction_handler != nullptr]];
    goto* instruction_handler;
    // etc.

and we need to see if this nets us any benefit. I remember, in the past, seeing goto perform a nullptr check prior to performing the goto. The hope is that the assume will guide GCC to skip the nullptr check.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions