[PATCH] D84007: [ValueTracking] Change canCreatePoison to take Operator, add canCreateUndef

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 17 12:01:18 PDT 2020


nikic added inline comments.


================
Comment at: llvm/lib/Analysis/ValueTracking.cpp:4783
+
+  return false;
 }
----------------
jdoerfert wrote:
> nikic wrote:
> > jdoerfert wrote:
> > > This seems wrong. A load of an uninitialized location should produce `undef` for example, shouldn't it? I fear there are way more things that can produce `undef`. The default should be true here.
> > Returning true here would make this function always return true :) If we drop the "undef only" mode, then returning false should be fine, as this function only needs to deal with cases where undef is possible but poison is not.
> What about my load example? poison is not possible but undef is, returning false still seems wrong, or maybe I'm just confused..
Loads can also return poison, and canCreatePoison() will return true for them. (Having load/store implicitly filter poison would prevent mem2reg/SROA.)


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D84007





More information about the llvm-commits mailing list