[PATCH] D75120: [ValueLattice] Add new state for undef constants. (WIP)

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 25 08:01:43 PST 2020


fhahn created this revision.
Herald added a subscriber: hiraditya.
Herald added a project: LLVM.

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.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D75120

Files:
  llvm/include/llvm/Analysis/ValueLattice.h
  llvm/lib/Analysis/LazyValueInfo.cpp
  llvm/lib/Analysis/ValueLattice.cpp
  llvm/lib/Transforms/Scalar/SCCP.cpp
  llvm/test/Transforms/CorrelatedValuePropagation/merge-range-and-undef.ll
  llvm/test/Transforms/SCCP/float-phis.ll
  llvm/test/Transforms/SCCP/int-phis.ll
  llvm/test/Transforms/SCCP/range-and.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D75120.246472.patch
Type: text/x-patch
Size: 19005 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200225/17b8cb18/attachment.bin>


More information about the llvm-commits mailing list