Issue 165947
Summary [AArch64] Suboptimal `memcpy` for non-power of two sizes
Labels backend:AArch64, missed-optimization
Assignees
Reporter Kmeakin
    Split off from https://github.com/llvm/llvm-project/issues/165625

https://godbolt.org/z/Yfq56nfTP

LLVM assembly:
```asm
copy65:
        ldr     q0, [x1]
        str     q0, [x0]
        ldp     q2, q0, [x1, #32]
        ldrb    w8, [x1, #64]
 ldr     q1, [x1, #16]
        strb    w8, [x0, #64]
        stp     q2, q0, [x0, #32]
        str     q1, [x0, #16]
        ret
```

GCC assembly:
```asm
copy65:
        ldp     q29, q28, [x1]
        ldp q31, q30, [x1, 32]
        ldrb    w1, [x1, 64]
        stp     q29, q28, [x0]
        stp     q31, q30, [x0, 32]
        strb    w1, [x0, 64]
 ret
```

_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to