- 
                Notifications
    You must be signed in to change notification settings 
- Fork 5.2k
Closed
Labels
area-CodeGen-coreclrCLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMICLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI
Milestone
Description
The codegen of B is better (less cpu cycles).
    public int A(int a) {
        a++; // inc edx
        a++; // inc edx
        return a;
    }
    
    public int B(int a) {
        a += 2; // add edx, 2
        return a;
    }Expected result
- inc edx
- inc edx
+ add edx, 2
  mov eax, edx
  retShreyasJejurkar, SommerEngineering, hez2010 and 1337NirflectorSommerEngineering
Metadata
Metadata
Assignees
Labels
area-CodeGen-coreclrCLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMICLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI