[all-commits] [llvm/llvm-project] 59a063: [ExpandMemCmp] Improve memcmp optimisation for boo...

Igor Kirillov via All-commits all-commits at lists.llvm.org
Thu Nov 9 03:52:22 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 59a063d5c65d963ef20529b49796c83aeb33e864
      https://github.com/llvm/llvm-project/commit/59a063d5c65d963ef20529b49796c83aeb33e864
  Author: Igor Kirillov <igor.kirillov at arm.com>
  Date:   2023-11-09 (Thu, 09 Nov 2023)

  Changed paths:
    M llvm/lib/CodeGen/ExpandMemCmp.cpp
    M llvm/test/CodeGen/AArch64/memcmp.ll
    M llvm/test/CodeGen/X86/memcmp-more-load-pairs-x32.ll
    M llvm/test/CodeGen/X86/memcmp-more-load-pairs.ll
    M llvm/test/CodeGen/X86/memcmp-x32.ll
    M llvm/test/CodeGen/X86/memcmp.ll

  Log Message:
  -----------
  [ExpandMemCmp] Improve memcmp optimisation for boolean results (#71221)

This patch enhances the optimization of memcmp calls when only two
outcomes
are needed and comparison fits into one block, for example:

	bool result = memcmp(a, b, 6) > 0;

Previously, LLVM would generate unnecessary operations even when the
user of
memcmp was only interested in a binary outcome.




More information about the All-commits mailing list