[llvm] e9df5d6 - [LSR] Remove a couple stale comments in lsr-term-fold

Philip Reames via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 21 09:21:36 PDT 2023


Author: Philip Reames
Date: 2023-03-21T09:21:30-07:00
New Revision: e9df5d62c8353a81815658bdbf6f9fc0e54a9c37

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

LOG: [LSR] Remove a couple stale comments in lsr-term-fold

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp b/llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp
index 35a90bf40deb..3e5e0987e10c 100644
--- a/llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp
+++ b/llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp
@@ -6700,9 +6700,6 @@ canFoldTermCondOfLoop(Loop *L, ScalarEvolution &SE, DominatorTree &DT,
   }
 
   BasicBlock *LoopLatch = L->getLoopLatch();
-
-  // TODO: Can we do something for greater than and less than?
-  // Terminating condition is foldable when it is an eq/ne icmp
   BranchInst *BI = cast<BranchInst>(LoopLatch->getTerminator());
   if (BI->isUnconditional())
     return std::nullopt;
@@ -6948,8 +6945,6 @@ static bool ReduceLoopStrength(Loop *L, IVUsers &IU, ScalarEvolution &SE,
       BranchInst *BI = cast<BranchInst>(LoopLatch->getTerminator());
       ICmpInst *OldTermCond = cast<ICmpInst>(BI->getCondition());
       IRBuilder<> LatchBuilder(LoopLatch->getTerminator());
-      // FIXME: We are adding a use of an IV here without account for poison safety.
-      // This is incorrect.
       Value *NewTermCond =
           LatchBuilder.CreateICmp(CmpInst::ICMP_EQ, LoopValue, TermValue,
                                   "lsr_fold_term_cond.replaced_term_cond");


        


More information about the llvm-commits mailing list