[PATCH] D102550: [ValueTracking] Mark GEP operand as nonnull if the result was loaded or stored

Roman Lebedev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat May 15 04:20:19 PDT 2021


lebedev.ri added inline comments.


================
Comment at: llvm/lib/Analysis/ValueTracking.cpp:2137
+          V == GEP->getPointerOperand() &&
+          isGEPKnownNonNull(GEP, Depth + 1, Q)) {
+        unsigned GEPUsesExplored = 0;
----------------
danlark wrote:
> lebedev.ri wrote:
> > Doesn't this cause endless recursion back into `isKnownNonNullFromDominatingCondition()`
> > for the very same value we've started with?
> > (and we happen to not deadloop just because of depth cutoff)
> > 
> isKnownNonZero has Depth cutoff before isKnownNonNullFromDominatingCondition
> 
> https://github.com/llvm/llvm-project/blob/e38ccb729b205b076356684e055efb7dfc673963/llvm/lib/Analysis/ValueTracking.cpp#L2304-L2336
Sure, but before that cutoff triggers, won't we waste time mutually recursing with no progress?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D102550



More information about the llvm-commits mailing list