[llvm-commits] CVS: llvm/lib/Analysis/ScalarEvolution.cpp

Dan Gohman djg at cray.com
Mon Jun 18 13:35:17 PDT 2007

> > +  // Now we know the first non-constant operand.  Skip past any  
> > cast SCEVs.
> > +  while (Idx < Ops.size() && Ops[Idx]->getSCEVType() < scAddExpr)
> > +    ++Idx;
> Can you please introduce a predicate for this?  Comparing against  
> scAddExpr is not obvious :)

I think if you read the whole body of SCEVAddExpr::get instead of just what's
in this diff, it'll be more more obvious. The operands of theSCEVAddExpr are
sorted by their getSCEVType() value, and the code is walking through them
expecting to deal with each kind in that order.


Dan Gohman, Cray Inc.

More information about the llvm-commits mailing list