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

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 14 06:07:49 PDT 2021


fhahn added inline comments.


================
Comment at: llvm/include/llvm/Analysis/ValueTracking.h:609
+  bool propagatesPoison(const Operator *I,
+                        const Value *ValAssumedPoison = nullptr);
 
----------------
nikic wrote:
> fhahn wrote:
> > nikic wrote:
> > > Can we make this function accept (only) a `Use`?
> > I think that should be possible, it just requires updating a few of the users.
> This isn't really what I had in mind. Why do we need both an Operator and a Use? Can't we make this API accept only a (required) Use and dispatch based on `U.getUser()`? Are there any usages that don't work on a specific Use?
That's an option. If we do not want to provide 2 versions of the function this requires updating all users to actually check which operands are poison before calling `propagatesPoison`. I did that in the latest iteration of the patch. It doesn't look too bad, I am not sure if the convenience of having a version that does not require specifying *which* operand may be poison would still be desirable.


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