[PATCH] D51431: [WIP][IPSCCP] Add lattice value for != constant and propagate nonnull.

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 11 19:13:43 PDT 2018


efriedma added a reviewer: nlopes.
efriedma added a comment.

You're making the lattice really confusing.  Essentially, there are now two different merging rules: one is used if the caller calls mergeInValue, and a different one is used if the caller calls markNotConstant etc.  So it's not obvious what the lattice actually represents.

----

And actually, thinking about it a bit more, there's a more fundamental problem with proving a value is non-null.  Given that a value is possibly-undef, it could be null even for code dominated by a null-check. So the entire proposed transform is unsound unless you freeze the pointer.

This doesn't normally cause a problem for existing SCCP analysis because the only transform SCCP usually performs is refining an value to a specific constant.  (It also erases dead code, but that isn't really relevant here.)  Along a path where x==null is true, it's possible for x to evaluate to some non-null value. but it's still okay for SCCP to replace x with null.


https://reviews.llvm.org/D51431





More information about the llvm-commits mailing list