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

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 9 06:24:48 PDT 2020


fhahn added a comment.

In D75120#1906427 <https://reviews.llvm.org/D75120#1906427>, @fhahn wrote:

> In D75120#1893937 <https://reviews.llvm.org/D75120#1893937>, @efriedma wrote:
>
> > If you don't have all the relevant states represented in the ValueLattice, where are you storing the "possibly undef" bit?  I think having all the states in the ValueLattice is simpler, at least conceptually.
>
>
>


I've put up a patch that adds a new lattice state for single element constant ranges that started out/merged with undef: D75845 <https://reviews.llvm.org/D75845>. I hope that's along the lines you suggested.

I worked on an SCCP test case for that, but the way we currently handle PHIs means we merge all incoming values in the existing state for a PHI, which means that if the result is a constant range and any operands is undef, we will merge CR & undef, going to overdefined.

With an additional patch skipping some unnecessary updates (D75846 <https://reviews.llvm.org/D75846>), I managed to get a SCCP test case (llvm/test/Transforms/SCCP/range-and-ip.ll) in D75845 <https://reviews.llvm.org/D75845>. There's also a test case that shows the issue with CorrelatedValuePropagation.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D75120/new/

https://reviews.llvm.org/D75120





More information about the llvm-commits mailing list