[all-commits] [llvm/llvm-project] 6de530: [X86] For minsize memset/memcpy, use byte or doubl...

Rose via All-commits all-commits at lists.llvm.org
Sat Oct 5 21:30:39 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 6de5305b3d7a4a19a29b35d481a8090e2a6d3a7e
      https://github.com/llvm/llvm-project/commit/6de5305b3d7a4a19a29b35d481a8090e2a6d3a7e
  Author: Rose <gfunni234 at gmail.com>
  Date:   2024-10-06 (Sun, 06 Oct 2024)

  Changed paths:
    M llvm/lib/Target/X86/X86SelectionDAGInfo.cpp
    M llvm/test/CodeGen/X86/memcpy-struct-by-value.ll
    M llvm/test/CodeGen/X86/memcpy.ll
    M llvm/test/CodeGen/X86/memset-minsize.ll
    M llvm/test/CodeGen/X86/memset-vs-memset-inline.ll

  Log Message:
  -----------
  [X86] For minsize memset/memcpy, use byte or double-word accesses (#87003)

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.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list