[PATCH] D78503: RFC: [ValueTracking] Let analyses assume a value cannot be partially poison

Juneyoung Lee via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 20 11:21:36 PDT 2020


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


================
Comment at: llvm/include/llvm/Analysis/ValueTracking.h:568
+  /// If I raises immediate UB (e.g. load poison), propagatesPoison returns
+  /// false.
+  bool propagatesPoison(const Instruction *I);
----------------
nikic wrote:
> This doesn't seem to line up with the implementation, e.g. division ops return true for propagatesPoison.
> 
> I'm also not sure why we would not want to return true for immediate UB. It's a stronger condition, but it should always be fine to relax immediate UB into returning poison.
Thanks, fixed.

> I'm also not sure why we would not want to return true for immediate UB. It's a stronger condition, but it should always be fine to relax immediate UB into returning poison.

I think this is more natural in the sense that the operation wouldn't return a value when UB happened; it immediately exits the program.
It is analogous to what canCreatePoison(I) returns when I raises UB as well.



Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D78503





More information about the llvm-commits mailing list