[PATCH] D111643: [ValueTracking] Let propgatesPoison consider single poison operand.

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Dec 18 11:25:03 PST 2022


nikic requested changes to this revision.
nikic added inline comments.
This revision now requires changes to proceed.


================
Comment at: llvm/include/llvm/Analysis/ValueTracking.h:630
+/// getGuaranteedNonPoisonOp.
+bool propagatesPoison(const Use &PoisonOp);
+
----------------
Shouldn't this be modifying the declaration above?


================
Comment at: llvm/lib/Analysis/ValueTracking.cpp:5811
+      if (any_of(I.operands(),
+                 [=](const Use &Op) { return propagatesPoison(Op); })) {
         for (const Value *Op : I.operands()) {
----------------
This is incorrect, needs to be synchronized with the YieldsPoison check below.


================
Comment at: llvm/lib/Transforms/Instrumentation/PoisonChecking.cpp:293
+        for (const Use &U : I.operands()) {
+          if (ValToPoison.find(U) != ValToPoison.end() &&
+                 propagatesPoison(U) )
----------------
count/contains. Also the indentation looks broken here.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D111643



More information about the llvm-commits mailing list