https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114782

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
I should note I tested aarch64 (where lea 3 operand instructions are still
cheap) and powerpc (where lea like instructions don't exist) and they produce
what I expect, aarch64 produces an lea like instruction while powerpc produces
no shifts/multiplies for the loop.

PowerPC:
.L3:
        addi 9,9,-1
        add 8,8,10
        subf 7,9,6
        addi 10,10,5
        cmpw 0,9,7
        bgt 0,.L3

aarch64 (default tuning):
.L3:
        add     w3, w0, w0, lsl 2
        sub     w1, w1, #1
        add     w0, w0, 1
        add     w2, w2, w3
        cmp     w1, w0
        bgt     .L3

aarch64 (thunderxt99 tuning):
.L3:
        sub     w0, w0, #1
        add     w2, w2, w1
        add     w1, w1, 5
        sub     w3, w4, w0
        cmp     w0, w3
        bgt     .L3

Reply via email to