[llvm] a124b4c - [LFTR] Simplify another case under assumption exit counts are integers [nfc]

Philip Reames via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 21 19:18:14 PDT 2023


Author: Philip Reames
Date: 2023-03-21T19:17:31-07:00
New Revision: a124b4c7f9f8b06724284b86ba8bfc2137e8c21b

URL: https://github.com/llvm/llvm-project/commit/a124b4c7f9f8b06724284b86ba8bfc2137e8c21b
DIFF: https://github.com/llvm/llvm-project/commit/a124b4c7f9f8b06724284b86ba8bfc2137e8c21b.diff

LOG: [LFTR] Simplify another case under assumption exit counts are integers [nfc]

This invariant was introduced in 8f3d16905d75b07a933d01dc29677fe5867c1b3e.

Added: 
    

Modified: 
    llvm/lib/Transforms/Scalar/IndVarSimplify.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp b/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp
index 18c3fe06503b4..5d6778ac75818 100644
--- a/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp
+++ b/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp
@@ -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.


        


More information about the llvm-commits mailing list