[all-commits] [llvm/llvm-project] 4878aa: [ValueLattice] Add new state for undef constants.

Florian Hahn via All-commits all-commits at lists.llvm.org
Sat Mar 14 10:23:11 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 4878aa36d4aa27df644430139fab2734fde4a000
      https://github.com/llvm/llvm-project/commit/4878aa36d4aa27df644430139fab2734fde4a000
  Author: Florian Hahn <flo at fhahn.com>
  Date:   2020-03-14 (Sat, 14 Mar 2020)

  Changed paths:
    M llvm/include/llvm/Analysis/ValueLattice.h
    M llvm/lib/Analysis/LazyValueInfo.cpp
    M llvm/lib/Analysis/ValueLattice.cpp
    M llvm/lib/Transforms/Scalar/SCCP.cpp
    M llvm/test/Transforms/CorrelatedValuePropagation/merge-range-and-undef.ll
    A llvm/test/Transforms/JumpThreading/ne-undef.ll
    A llvm/test/Transforms/SCCP/float-phis.ll
    A llvm/test/Transforms/SCCP/int-phis.ll

  Log Message:
  -----------
  [ValueLattice] Add new state for undef constants.

This patch adds a new undef lattice state, which is used to represent
UndefValue constants or instructions producing undef.

The main difference to the unknown state is that merging undef values
with constants (or single element constant ranges) produces  the
constant/constant range, assuming all uses of the merge result will be
replaced by the found constant.

Contrary, merging non-single element ranges with undef needs to go to
overdefined. Using unknown for UndefValues currently causes mis-compiles
in CVP/LVI (PR44949) and will become problematic once we use
ValueLatticeElement for SCCP.

Reviewers: efriedma, reames, davide, nikic

Reviewed By: efriedma

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




More information about the All-commits mailing list