Revert "[NFCI][ValueTracking] getUnderlyingObject(): assert that no cycles are encoun...
authorRoman Lebedev <lebedev.ri@gmail.com>
Mon, 15 Mar 2021 09:00:22 +0000 (12:00 +0300)
committerRoman Lebedev <lebedev.ri@gmail.com>
Mon, 15 Mar 2021 09:00:59 +0000 (12:00 +0300)
This reverts commit 36f1c3db66f7268ea3183bcf0bbf05b3e1c570b4.
Seems to make bots unhappy.

llvm/lib/Analysis/ValueTracking.cpp

index 8c44d73..79399cf 100644 (file)
@@ -4165,11 +4165,7 @@ static bool isSameUnderlyingObjectInLoop(const PHINode *PN,
 const Value *llvm::getUnderlyingObject(const Value *V, unsigned MaxLookup) {
   if (!V->getType()->isPointerTy())
     return V;
-#ifndef NDEBUG
-  SmallPtrSet<const Value *, 8> Visited;
-#endif
   for (unsigned Count = 0; MaxLookup == 0 || Count < MaxLookup; ++Count) {
-    assert(Visited.insert(V).second && "Cycle detected. Unreachable code?");
     if (auto *GEP = dyn_cast<GEPOperator>(V)) {
       V = GEP->getPointerOperand();
     } else if (Operator::getOpcode(V) == Instruction::BitCast ||