[PATCH] D96929: [ValueTracking] Improve impliesPoison

Juneyoung Lee via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 17 20:15:45 PST 2021


aqjune added inline comments.


================
Comment at: llvm/include/llvm/Analysis/ValueTracking.h:587
   /// getGuaranteedNonPoisonOp.
   bool propagatesPoison(const Operator *I);
 
----------------
I chose to not make `propagatesPoison` return true on `extractvalue` because otherwise we lose this nice property:
"If propagatesPoison(op x y) is true, and the result is non-poison, x and y are also non-poison"
If `extractvalue` is added, this doesn't hold any more; imagine
```
%aggr = { i64 poison, i64 0 }
%I = extractvalue %aggr, 1
; propagatesPoison(extractvalue %aggr, 1) now returns true, and the result is well-defined (constant 0), but %aggr isn't well-defined
```



Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D96929



More information about the llvm-commits mailing list