Skip to content

RyuJIT doesn't eliminate a jump to the next instruction #4326

Description

@mikedn

C# code:

using System;

class Program {
    static int Main(string[] args) {
        return Math.Max(args.Length, 42);
    }
}

Generated code:

G_M17764_IG01:

G_M17764_IG02:
       8B4108               mov      eax, dword ptr [rcx+8]
       83F82A               cmp      eax, 42
       7D07                 jge      SHORT G_M17764_IG03
       B82A000000           mov      eax, 42
       EB00                 jmp      SHORT G_M17764_IG03  ;huh???

G_M17764_IG03:
       C3                   ret

category:cq
theme:basic-cq
skill-level:intermediate
cost:medium

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

    area-CodeGen-coreclrCLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMIenhancementProduct code improvement that does NOT require public API changes/additionsoptimizationtenet-performancePerformance related issue

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions