[all-commits] [llvm/llvm-project] 419c69: [SimplifyLibCalls] Remove over-eager early return ...

Florian Hahn via All-commits all-commits at lists.llvm.org
Thu Aug 27 07:20:33 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 419c6948df420dc2638e74a2b409e1d117256050
      https://github.com/llvm/llvm-project/commit/419c6948df420dc2638e74a2b409e1d117256050
  Author: Florian Hahn <flo at fhahn.com>
  Date:   2020-08-27 (Thu, 27 Aug 2020)

  Changed paths:
    M llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp
    M llvm/test/Transforms/InstCombine/strlen-1.ll

  Log Message:
  -----------
  [SimplifyLibCalls] Remove over-eager early return in strlen optzns.

Currently we bail out early for strlen calls with a GEP operand, if none
of the GEP specific optimizations fire. But there could be later
optimizations that still apply,  which we currently miss out on.

An example is that we do not apply the following optimization
   strlen(x) == 0 --> *x == 0

Unless I am missing something, there seems to be no reason for bailing
out early there.

Fixes PR47149.

Reviewed By: lebedev.ri, xbolva00

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




More information about the All-commits mailing list