[all-commits] [llvm/llvm-project] d236e1: [InstSimplify/NewGVN] Add option to control the us...

Florian Hahn via All-commits all-commits at lists.llvm.org
Sun Aug 9 11:23:47 PDT 2020


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

  Changed paths:
    M llvm/include/llvm/Analysis/InstructionSimplify.h
    M llvm/lib/Analysis/InstructionSimplify.cpp
    M llvm/lib/Transforms/Scalar/NewGVN.cpp
    A llvm/test/Transforms/NewGVN/pr33165-distribute-undef.ll
    R llvm/test/Transforms/NewGVN/todo-pr33165-distribute-undef.ll

  Log Message:
  -----------
  [InstSimplify/NewGVN] Add option to control the use of undef.

Making use of undef is not safe if the simplification result is not used
to replace all uses of the result. This leads to problems in NewGVN,
which does not replace all uses in the IR directly. See PR33165 for more
details.

This patch adds an option to SimplifyQuery to disable the use of undef.

Note that I've only guarded uses if isa<UndefValue>/m_Undef where
SimplifyQuery is currently available. If we agree on the general
direction, I'll update the remaining uses.

Reviewed By: nikic

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




More information about the All-commits mailing list