Skip to content

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

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.

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

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions