[PATCH] D141850: [SCEV] Preserve divisibility and min/max information in applyLoopGuards

Max Kazantsev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 31 08:46:44 PST 2023


mkazantsev added inline comments.


================
Comment at: llvm/lib/Analysis/ScalarEvolution.cpp:15018
+                                        const SCEV *&LHS, const SCEV *&RHS) {
+      if (auto MinMax = dyn_cast<SCEVMinMaxExpr>(Expr)) {
+        SCTy = MinMax->getSCEVType();
----------------
alonkom wrote:
> alonkom wrote:
> > mkazantsev wrote:
> > > caojoshua wrote:
> > > > SequentialMinMax SCEVs can be applied here as well.
> > > I'd prefer it to be a separate patch, if it's legal at all. Need to check carefully how poison flows in these formulae.
> > They are not created in this function, so I prefer only handling MinMax at this point.
> can you explain what isn't legal here?
> just checking if this is a min/max of 2 operands, when the 2nd one is constant.
I mean "I would prefer adding sequential min/max in a separate patch". Meaning, so far so good here.


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

https://reviews.llvm.org/D141850



More information about the llvm-commits mailing list