[llvm-dev] Where's the optimiser gone? Or: who reviews the code you ship?

Travis Finkenauer via llvm-dev llvm-dev at lists.llvm.org
Sun Sep 6 20:00:41 PDT 2020


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


More information about the llvm-dev mailing list