[PATCH] D148661: [SCEV] Common code for computing trip count in a fixed type [NFC-ish]

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 18 16:09:04 PDT 2023


craig.topper added inline comments.


================
Comment at: llvm/lib/Analysis/ScalarEvolution.cpp:8076
+
+  // If we need to need to zero extend the backedge count, check if we can
+  // add one to it prior to zero extending without overflow. Provided this is
----------------
"need to need to"


================
Comment at: llvm/lib/Transforms/Scalar/LoopFlatten.cpp:318
 
-  // The Extend=false flag is used for getTripCountFromExitCount as we want
-  // to verify and match it with the pattern matched tripcount. Please note
-  // that overflow checks are performed in checkOverflow, but are first tried
-  // to avoid by widening the IV.
+  // Evaluating in the trip counts type can not overflow here as the overflow
+  // checks are performed in checkOverflow, but are first tried to avoid by
----------------
counts -> count's ?


================
Comment at: llvm/lib/Transforms/Scalar/LoopFlatten.cpp:319
+  // Evaluating in the trip counts type can not overflow here as the overflow
+  // checks are performed in checkOverflow, but are first tried to avoid by
+  // widening the IV.
----------------
"avoid by widening"


================
Comment at: llvm/lib/Transforms/Scalar/LoopIdiomRecognize.cpp:994
+  const SCEV *TripCountSCEV =
+    SE->getTripCountFromExitCount(BECount, IntPtr, CurLoop);
   return SE->getMulExpr(TripCountSCEV,
----------------
Isn't clang-format for line wrap 4 spaces of indention?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D148661/new/

https://reviews.llvm.org/D148661



More information about the llvm-commits mailing list