diff options
author | Nikita Popov <nikita.ppv@gmail.com> | 2021-03-15 13:12:39 +0100 |
---|---|---|
committer | Nikita Popov <nikita.ppv@gmail.com> | 2021-03-15 13:12:39 +0100 |
commit | 5fb43477dcacd6fca573699dd2691a17eae7dc7e (patch) | |
tree | 2db41457751f609dbcd055d010d1b83163758c3b /llvm/lib/Analysis/ValueTracking.cpp | |
parent | 9ba577eca2e339726bfaad4e615c6324a705b292 (diff) | |
download | llvm-5fb43477dcacd6fca573699dd2691a17eae7dc7e.zip llvm-5fb43477dcacd6fca573699dd2691a17eae7dc7e.tar.gz llvm-5fb43477dcacd6fca573699dd2691a17eae7dc7e.tar.bz2 |
Revert "[NFCI][ValueTracking] getUnderlyingObject(): gracefully handle cycles"
This reverts commit aa440ba24dc25e4c95f6dcf8ff647024f3b12661.
This has a non-trivial compile-time impact:
https://llvm-compile-time-tracker.com/compare.php?from=0c5b789c7342ee8384507c3242fc256e23248c4d&to=aa440ba24dc25e4c95f6dcf8ff647024f3b12661&stat=instructions
I don't believe this is the correct way to address the issue in
this case.
Diffstat (limited to 'llvm/lib/Analysis/ValueTracking.cpp')
-rw-r--r-- | llvm/lib/Analysis/ValueTracking.cpp | 6 |
1 files changed, 0 insertions, 6 deletions
diff --git a/llvm/lib/Analysis/ValueTracking.cpp b/llvm/lib/Analysis/ValueTracking.cpp index 5fe0269..79399cf 100644 --- a/llvm/lib/Analysis/ValueTracking.cpp +++ b/llvm/lib/Analysis/ValueTracking.cpp @@ -4165,13 +4165,7 @@ static bool isSameUnderlyingObjectInLoop(const PHINode *PN, const Value *llvm::getUnderlyingObject(const Value *V, unsigned MaxLookup) { if (!V->getType()->isPointerTy()) return V; - // Keep track of all the values we have recursed through. - SmallPtrSet<const Value *, 8> Visited; for (unsigned Count = 0; MaxLookup == 0 || Count < MaxLookup; ++Count) { - // Did we encounter this value already? - if (!Visited.insert(V).second) - return V; // Cycle detected, we must be in an unreachable code. - // Otherwise, recurse further. if (auto *GEP = dyn_cast<GEPOperator>(V)) { V = GEP->getPointerOperand(); } else if (Operator::getOpcode(V) == Instruction::BitCast || |