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

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 11 12:29:38 PDT 2020


fhahn marked an inline comment as done.
fhahn added inline comments.


================
Comment at: llvm/include/llvm/Analysis/ValueLattice.h:137
+    if (isa<UndefValue>(C))
+      Res.markUndefined();
+    else
----------------
efriedma wrote:
> I'm not sure I understand how getNot(undef) is supposed to work.
I think it should be fine to assume `x != undef => undef`. Alive seems to agree. Granted, it is probably not very useful. I tried to replace it with an assert ruling out undef here, but we hit this case in practice in LVI via JumpThreading.


================
Comment at: llvm/include/llvm/Analysis/ValueLattice.h:297
       *this = RHS;
-      return !RHS.isUndefined();
+      return !RHS.isUnknown();
     }
----------------
efriedma wrote:
> We already checked RHS.isUnknown() earlier?
Done, thanks! I've added an assertion to guard against accidentally breaking the assumption by changes.


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