[all-commits] [llvm/llvm-project] 0d68ff: [InstCombine] Transform strrchr to memrchr for con...

Martin Sebor via All-commits all-commits at lists.llvm.org
Fri Jul 1 10:12:39 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 0d68ff87d2b03522ac43646a491d731586518e4c
      https://github.com/llvm/llvm-project/commit/0d68ff87d2b03522ac43646a491d731586518e4c
  Author: Martin Sebor <msebor at redhat.com>
  Date:   2022-07-01 (Fri, 01 Jul 2022)

  Changed paths:
    M llvm/include/llvm/Transforms/Utils/BuildLibCalls.h
    M llvm/lib/Transforms/Utils/BuildLibCalls.cpp
    M llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp
    M llvm/test/Transforms/InstCombine/strcall-no-nul.ll
    M llvm/test/Transforms/InstCombine/strrchr-1.ll
    A llvm/test/Transforms/InstCombine/strrchr-3.ll

  Log Message:
  -----------
  [InstCombine] Transform strrchr to memrchr for constant strings

Add an emitter for the memrchr common extension and simplify the strrchr
call handler to use it. This enables transforming calls with the empty
string to the test C ? S : 0.

Reviewed By: nikic

Differential Revision: https://reviews.llvm.org/D128954


  Commit: d8b22243c8e97181b81993e8e714539d6b73ff27
      https://github.com/llvm/llvm-project/commit/d8b22243c8e97181b81993e8e714539d6b73ff27
  Author: Martin Sebor <msebor at redhat.com>
  Date:   2022-07-01 (Fri, 01 Jul 2022)

  Changed paths:
    A llvm/test/Transforms/InstCombine/memchr-11.ll
    A llvm/test/Transforms/InstCombine/memrchr-8.ll
    A llvm/test/Transforms/InstCombine/strchr-4.ll

  Log Message:
  -----------
  [InstCombine] Add tests in anticipation of D128939 (NFC)

Precommit tests exercising the future folding of memchr and strchr calls
in equality expressions with the first function argument.


Compare: https://github.com/llvm/llvm-project/compare/554aea52d79e...d8b22243c8e9


More information about the All-commits mailing list