[all-commits] [llvm/llvm-project] 8e4efa: [libc] Optimize Loop strategy

Guillaume Chatelet via All-commits all-commits at lists.llvm.org
Mon Aug 16 15:18:18 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 8e4efad9917ce0b7d1751c34a8d6907e610050e6
      https://github.com/llvm/llvm-project/commit/8e4efad9917ce0b7d1751c34a8d6907e610050e6
  Author: Guillaume Chatelet <gchatelet at google.com>
  Date:   2021-08-16 (Mon, 16 Aug 2021)

  Changed paths:
    M libc/src/string/memory_utils/elements.h

  Log Message:
  -----------
  [libc] Optimize Loop strategy

Since the precondition for loop is `size >= T::kSize` we always expect
at least one run of the loop. This patch transforms the for-loop into a
do/while-loop which saves at least one test.

We also add a second template parameter to allow the Tail operation to
differ from the loop operation.




More information about the All-commits mailing list