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

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 11 13:02:08 PDT 2020


efriedma added inline comments.


================
Comment at: llvm/include/llvm/Analysis/ValueLattice.h:137
+    if (isa<UndefValue>(C))
+      Res.markUndefined();
+    else
----------------
fhahn wrote:
> 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.
If you prove x != undef, x can't be any specific value... including undef, I think.  So actually you could just treat it as unknown, I think?


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