[llvm] [polly] [llvm][ConstraintElimination]Insert ConditionFact into loop header in case of monotonic induction variables (PR #112080)

Matthias Braun via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 31 13:34:42 PDT 2024


================
@@ -900,10 +905,88 @@ static void dumpConstraint(ArrayRef<int64_t> C,
 }
 #endif
 
+static Value *getStartValueFromAddRec(PHINode &PN, Loop &L,
+                                      ScalarEvolution &SE) {
+  auto *AR = dyn_cast_or_null<SCEVAddRecExpr>(SE.getSCEV(&PN));
----------------
MatzeB wrote:

I think this is only called in contexts where this cast is guaranteed to succeed. So I'd probably just pass the existing `AR` as a parameter (or at least use an unchecked `cast<>` instead of a `dyn_cast_or_null<>`).

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


More information about the llvm-commits mailing list