[PATCH] D30445: [ValueTracking] Add a isIVNeverPoison helper

Philip Reames via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 5 12:30:13 PDT 2017


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


================
Comment at: include/llvm/Analysis/ValueTracking.h:425
+  ///
+  /// The second component of the return value may be non-null only if
+  /// the first component is false.  If non-null, it is the poison
----------------
Hm, this interface seems likely problematic.  How does this handle the case where poison can be introduced by two different sources?  Do we need an iterator abstraction?  Or can we reliably just return null for those?

(If the later, please clarify in the comment.)


================
Comment at: lib/Analysis/ValueTracking.cpp:3917
+  auto *PN = cast<PHINode>(*PHIOpItr);
+  assert(PN->getParent() == L->getHeader() && "Precondition violated!");
+  if (PN->getIncomingValueForBlock(L->getLoopLatch()) != I)
----------------
What prevents this induction variable from being part of a longer phi cycle?  i.e. a indvar with conditional increments for instance?  i.e. this shouldn't be an assert of the documentation needs updated.


https://reviews.llvm.org/D30445





More information about the llvm-commits mailing list