Skip to content
This repository was archived by the owner on Nov 13, 2026. It is now read-only.
This repository was archived by the owner on Nov 13, 2026. It is now read-only.

Implement nop opcode #4529

Closed
Closed

Description

@morganbr

Implement the nop opcode. This opcode doesn't do anything, but it would be good to emit a nop in debug builds since it can affect debugging. It might be possible do this by calling the llvm.donothing intrinsic. The method to fill in is:

Activity

  1. jacano commented on Oct 20, 2017

    @jacano
    Contributor

    Just wondering how to detect whether we are in a debug build or not in order to activate this emit...
    Could I use this argument to activate it?

    syntax.DefineOption("g", ref _enableDebugInfo, "Emit debugging information");

    Or using the optimization level?

  2. morganbr commented on Oct 20, 2017

    @morganbr
    ContributorAuthor

    I'd suggest using the optimization level since skipping nops is an optimization. You probably need to propagate WebAssemblyCodeGenCompilationBuilder's _optimizationMode field to WebAssemblyCodeGenCompilation so that the ILToWebAssemblyImporter can check it.

  3. MichalStrehovsky commented on Oct 20, 2017

    @MichalStrehovsky
    Member

    I'd suggest using the optimization level

    Why do we need to do that? LLVM wouldn't optimize this away on it's own when set up to optimize?

  4. morganbr commented on Oct 20, 2017

    @morganbr
    ContributorAuthor

    That's fine too. Having the plumbing for optimization will probably come in handy at some point, but it's optional for this change.

  5. jacano commented on Oct 22, 2017

    @jacano
    Contributor

    Yes, emscripten could do that for us. So only the llvm.donothing intrinsic call.

  6. added a commit that references this issue on Oct 22, 2017
    3ce0d6f
  7. added a commit that references this issue on Oct 31, 2017
    dc61f59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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