[PATCH] D126962: [SCCP] Don't mark edges feasible when resolving undefs

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 20 14:41:33 PDT 2022


efriedma added inline comments.


================
Comment at: llvm/lib/Transforms/Utils/SCCPSolver.cpp:1450
+/// (e.g. for a phi node with one undef and one constant value, which becomes
+/// feasible later).
 ///
----------------
I don't think the example given in the comment is accurate. The lattice distinguishes between unknown and undef, so PHI nodes should propagate correctly.

The problem is other operations: for example, visitCastInst doesn't propagate undef values.  (This is an optimization: if the operand of a cast transitions from undef to a non-undef constant, we don't want to force the result of the cast to overdefined.  We might want to consider revisiting this once we're using poison more consistently.)


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

https://reviews.llvm.org/D126962



More information about the llvm-commits mailing list