Stefan Kanthak via llvm-dev
2020-Sep-04 10:30 UTC
[llvm-dev] Where's the optimiser gone? Or: who reviews the code you ship?
Hi @ll, who can tell me (or the world) why an optimising compiler emits the code sequence shown in the left column (found 4x in the "builtins" library)? In the middle column the expected code sequence. mov eax, 0 # xor eax, eax # -3 bytes cmp ecx, edx # cmp edx, ecx jb @f # ja @f cmp edx, ecx # # -2 bytes mov eax, 1 # # -5 bytes adc eax, 0 # adc eax, 1 # -2 insns @@: # @@: ret # ret Stefan -- <https://www.duden.de/rechtschreibung/Kanthaken>
Travis Finkenauer via llvm-dev
2020-Sep-07 03:00 UTC
[llvm-dev] Where's the optimiser gone? Or: who reviews the code you ship?
Hi Stefan, Could you answer these questions: 1) What is your input code? 2) What program are you running (and with what options)? Thanks, -Travis On Sun, Sep 6, 2020 at 11:07 AM Stefan Kanthak via llvm-dev <llvm-dev at lists.llvm.org> wrote:> > Hi @ll, > > who can tell me (or the world) why an optimising compiler emits the > code sequence shown in the left column (found 4x in the "builtins" > library)? > In the middle column the expected code sequence. > > mov eax, 0 # xor eax, eax # -3 bytes > cmp ecx, edx # cmp edx, ecx > jb @f # ja @f > cmp edx, ecx # # -2 bytes > mov eax, 1 # # -5 bytes > adc eax, 0 # adc eax, 1 # -2 insns > @@: # @@: > ret # ret > > Stefan > -- > <https://www.duden.de/rechtschreibung/Kanthaken> > _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org > https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev