[all-commits] [llvm/llvm-project] c3ca68: [InstCombine] Don't simplify calls without uses

Nikita Popov via All-commits all-commits at lists.llvm.org
Mon Mar 9 10:51:25 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: c3ca6876ed0cf833dfde681e18c37ed288bb554c
      https://github.com/llvm/llvm-project/commit/c3ca6876ed0cf833dfde681e18c37ed288bb554c
  Author: Nikita Popov <nikita.ppv at gmail.com>
  Date:   2020-03-09 (Mon, 09 Mar 2020)

  Changed paths:
    M llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp
    M llvm/test/Transforms/InstCombine/pr44245.ll

  Log Message:
  -----------
  [InstCombine] Don't simplify calls without uses

When simplifying a call without uses, replaceInstUsesWith() is
going to do nothing, but we'll skip all following folds. We can
only run into this problem with calls that both simplify and are
not trivially dead if unused, which currently seems to happen only
with calls to undef, as the test diff shows. When extending
SimplifyCall() to handle "returned" attributes, this becomes a much
bigger problem, so I'm fixing this first.

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




More information about the All-commits mailing list