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

2007-06-18 Thread Chris Lattner
On Jun 18, 2007, at 1:35 PM, Dan Gohman wrote: >>> + // 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 >> scA

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

2007-06-18 Thread Dan Gohman
> > + // 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 t

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

2007-06-18 Thread Chris Lattner
> In SCEVAddExpr::get, skip over any cast operands before looking for > nested > add operands after constant operands. The recent change to recognize > sign-extend expressions caused this to be exposed more often. Ok > + // Now we know the first non-constant operand. Skip past any > cast SC

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

2007-06-18 Thread Dan Gohman
> Nifty. Have you done any performance analysis of this? What cases > is it beneficial for? If this helps LSR, for example, can you please > add a testcase to verify this doesn't break in the future? It doesn't actually help LSR much. At this point, a signextend isn't much less opaque than an u

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

2007-06-15 Thread Chris Lattner
On Jun 15, 2007, at 7:38 AM, Dan Gohman wrote: > +case Instruction::SExt: > + return SCEVSignExtendExpr::get(getSCEV(I->getOperand(0)), I- > >getType()); > + Nifty. Have you done any performance analysis of this? What cases is it beneficial for? If this helps LSR, for example, can

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

2007-06-06 Thread Chris Lattner
On Jun 6, 2007, at 5:19 AM, Nick Lewycky wrote: > Chris Lattner wrote: >> The only thing that can use Instructions are other intstructions. As >> such, you can change the dyn_cast into cast >> and there is no need to check for null in the next line. > > Fixed. Thanks Chris! Even better fix, tha

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

2007-06-06 Thread Nick Lewycky
Chris Lattner wrote: > The only thing that can use Instructions are other intstructions. As > such, you can change the dyn_cast into cast > and there is no need to check for null in the next line. Fixed. Thanks Chris! Nick ___ llvm-commits mailing

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

2007-06-05 Thread Chris Lattner
> Fix PR1487: http://llvm.org/PR1487 and Transforms/IndVar/ > 2007-06-06-DeleteDanglesPtr.ll Thanks Nicholas, > /// client before it removes an instruction from the program, to > make sure > /// that no dangling references are left around. > void ScalarEvolutionsImpl::deleteInstructionFrom

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

2007-04-15 Thread Chris Lattner
> ScalarEvolution.cpp updated: 1.110 -> 1.111 > --- > Log message: > > For PR1336: http://llvm.org/PR1336 : > Fix a div-by-zero bug noticed by APInt. This fixes: > test/Transforms/IndVarsSimplify/exit_value_tests.llx Please revert this immediately. The bug was already fixed and this is not at a

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

2006-12-11 Thread Chris Lattner
> Index: llvm/lib/Analysis/ScalarEvolution.cpp > diff -u llvm/lib/Analysis/ScalarEvolution.cpp:1.69 llvm/lib/ > Analysis/ScalarEvolution.cpp:1.70 > --- llvm/lib/Analysis/ScalarEvolution.cpp:1.69Mon Dec 11 20:26:09 > 2006 > +++ llvm/lib/Analysis/ScalarEvolution.cpp Mon Dec 11 23:04:59

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

2006-12-05 Thread Chris Lattner
nice, thanks Reid! -Chris On Dec 5, 2006, at 2:40 PM, Reid Spencer wrote: > > > Changes in directory llvm/lib/Analysis: > > ScalarEvolution.cpp updated: 1.64 -> 1.65 > --- > Log message: > > Finally get the casting right in this file. Also, remove some > unnecessary > casting because sdiv does

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

2006-12-05 Thread Chris Lattner
> Long and short of it, I put the checks for integer back in and changed > the casts to use getTrunc or getZExt. Seems to work. Ok >> Fair enough, please make sure it happens at some point though. > > Okay, these are done now. Once stuff passes tests, I'll commit it. Thanks Reid! -Chris

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

2006-12-05 Thread Reid Spencer
On Tue, 2006-12-05 at 12:07 -0800, Chris Lattner wrote: > On Dec 5, 2006, at 11:58 AM, Reid Spencer wrote: > > On Tue, 2006-12-05 at 11:52 -0800, Chris Lattner wrote: > >>> SCEVHandle SCEVTruncateExpr::get(const SCEVHandle &Op, const Type > >>> *Ty) { > >>>if (SCEVConstant *SC = dyn_cast(Op))

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

2006-12-05 Thread Chris Lattner
On Dec 5, 2006, at 11:58 AM, Reid Spencer wrote: > On Tue, 2006-12-05 at 11:52 -0800, Chris Lattner wrote: >>> SCEVHandle SCEVTruncateExpr::get(const SCEVHandle &Op, const Type >>> *Ty) { >>>if (SCEVConstant *SC = dyn_cast(Op)) >>> -return SCEVUnknown::get(ConstantExpr::getCast(SC->getValu

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

2006-12-05 Thread Reid Spencer
On Tue, 2006-12-05 at 11:52 -0800, Chris Lattner wrote: > > SCEVHandle SCEVTruncateExpr::get(const SCEVHandle &Op, const Type > > *Ty) { > >if (SCEVConstant *SC = dyn_cast(Op)) > > -return SCEVUnknown::get(ConstantExpr::getCast(SC->getValue(), > > Ty)); > > +return SCEVUnknown::get

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

2006-12-05 Thread Chris Lattner
> SCEVHandle SCEVTruncateExpr::get(const SCEVHandle &Op, const Type > *Ty) { >if (SCEVConstant *SC = dyn_cast(Op)) > -return SCEVUnknown::get(ConstantExpr::getCast(SC->getValue(), > Ty)); > +return SCEVUnknown::get( > +ConstantExpr::getTruncOrBitCast(SC->getValue(), Ty));

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

2006-12-04 Thread Chris Lattner
Reid, I don't like this series of patches. You're replacing one evil with another. Please endeavor to figure out what type of cast is actually needed and put it in, rather than changing one sort of inferred cast into another. > Index: llvm/lib/Analysis/ScalarEvolution.cpp > diff -u llvm/l