[PATCH] D88207: [ValueTracking] Check uses of Argument if it is given to isGuaranteedNotToBeUndefOrPoison

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 24 13:49:46 PDT 2020


nikic added inline comments.


================
Comment at: llvm/lib/Analysis/ValueTracking.cpp:5165
+  if (!isa<Argument>(V) && !isa<Instruction>(V))
+    return false;
+
----------------
nikic wrote:
> aqjune wrote:
> > Unit tests say V can be MetadataAsValue as well (that is called from AANoUndefImpl::initialize).
> > But, does it imply that AANoUndefImpl::initialize should be fixed?
> I think it would be more elegant to write
> ```
> } else if (auto *Arg = dyn_cast<Argument>(V)) {
>    // ...
> } else {
>    return false;
> }
> ```
> below, rather than having having to keep the checks here and below in sync.
> Unit tests say V can be MetadataAsValue as well (that is called from AANoUndefImpl::initialize).
> But, does it imply that AANoUndefImpl::initialize should be fixed?

I don't think there's anything wrong with. It shouldn't cause issues for this code as implemented, right?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D88207



More information about the llvm-commits mailing list