[llvm] SCEV: avoid conflating unknown TC with wrap (NFC) (PR #94162)

Thorsten Schütt via llvm-commits llvm-commits at lists.llvm.org
Sun Jun 2 09:14:10 PDT 2024


================
@@ -6822,8 +6822,8 @@ canFoldTermCondOfLoop(Loop *L, ScalarEvolution &SE, DominatorTree &DT,
   // the allowed cost with the loops trip count as best we can.
   const unsigned ExpansionBudget = [&]() {
     unsigned Budget = 2 * SCEVCheapExpansionBudget;
-    if (unsigned SmallTC = SE.getSmallConstantMaxTripCount(L))
-      return std::min(Budget, SmallTC);
+    if (std::optional<unsigned> SmallTC = SE.getSmallConstantMaxTripCount(L))
+      return std::min(Budget, *SmallTC);
----------------
tschuett wrote:

Is the `*` really needed below the`if` ?

https://github.com/llvm/llvm-project/pull/94162


More information about the llvm-commits mailing list