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

Johannes Doerfert via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 17 09:20:48 PDT 2020


jdoerfert added inline comments.


================
Comment at: llvm/include/llvm/Analysis/ValueTracking.h:607
+  /// poison from non-undef & non-poison operands.
+  bool canCreateUndef(const Operator *Op, bool ConsiderPoisonAsUndef);
 
----------------
Drive by: Now that I see this, I would prefer the public API to have two functions. I'm fine if others disagree but for the users it seems more natural to have `canCreateUndef` and `canCreateUndefOrPoison`, (and maybe `canCreatePoison`).


================
Comment at: llvm/lib/Analysis/ValueTracking.cpp:4783
+
+  return false;
 }
----------------
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.


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