[LFTR] Simplify another case under assumption exit counts are integers [nfc]
authorPhilip Reames <preames@rivosinc.com>
Wed, 22 Mar 2023 02:04:14 +0000 (19:04 -0700)
committerPhilip Reames <listmail@philipreames.com>
Wed, 22 Mar 2023 02:17:31 +0000 (19:17 -0700)
This invariant was introduced in 8f3d16905d75b07a933d01dc29677fe5867c1b3e.

llvm/lib/Transforms/Scalar/IndVarSimplify.cpp

index 18c3fe0..5d6778a 100644 (file)
@@ -843,10 +843,6 @@ static PHINode *FindLoopCounter(Loop *L, BasicBlock *ExitingBB,
     if (!isLoopCounter(Phi, L, SE))
       continue;
 
-    // Avoid comparing an integer IV against a pointer Limit.
-    if (BECount->getType()->isPointerTy() && !Phi->getType()->isPointerTy())
-      continue;
-
     const auto *AR = cast<SCEVAddRecExpr>(SE->getSCEV(Phi));
 
     // AR may be a pointer type, while BECount is an integer type.