[llvm] [X86] For minsize memset/memcpy, use byte or double-word accesses (PR #87003)
via llvm-commits
llvm-commits at lists.llvm.org
Thu Oct 3 09:18:26 PDT 2024
AreaZR wrote:
> repstosb and repstosd are the same size, but stosd is only done for 0 because the process of multiplying the constant so that it is copied across the bytes of the 32-bit number adds extra instructions that cause the size to increase. For 0, repstosb and repstosd are the same size, but stosd is only done for 0 because the process of multiplying the constant so that it is copied across the bytes of the 32-bit number adds extra instructions that cause the size to increase. For 0, we do not need to do that at all.
>
> For memcpy, the same goes, and as a result the minsize check was moved ahead because a jmp to memcpy encoded takes more bytes than repmovsb.
Done!
https://github.com/llvm/llvm-project/pull/87003
More information about the llvm-commits
mailing list