[PATCH] D20695: Floating Point SCEV Analysis

Elena Demikhovsky via llvm-commits llvm-commits at lists.llvm.org
Sun Jun 5 05:30:14 PDT 2016


delena added a comment.

In http://reviews.llvm.org/D20695#447673, @sbaranga wrote:

> In http://reviews.llvm.org/D20695#447451, @sanjoy wrote:
>
> > In http://reviews.llvm.org/D20695#446877, @sbaranga wrote:
> >
> > > > float x = init;
> > >
> > > > 
> > >
> > > >   for (int i=0;i<N;i++){
> > >
> > > >     A[i] = x;
> > >
> > > >     x += fp_inc; // Loop invariant variable or constant
> > >
> > > >   }
> > >
> > >
> > >
> >
> >
> >
> >
> > > If this is correct with fast-math, we should be able to use this to
> >
> > >  get the backedge taken count - which would be a good reason for doing
> >
> > >  this in SCEV.
> >
> >
> > Shouldn't SCEV //today// be able to compute the backedge taken count of
> >  the above loop (since the controlling induction variable is
> >  integral)?
>
>
> Hi Sanjoy,
>
> For that loop, yes, SCEV should be able to figure out the backedge taken count today.
>
> But using that reasoning I think we should be able to get the backedge taken count for the following loop (again, I don't know if this is actually correct):
>
> float i = 0.f;
>  for (; i < N; i+=fp_inc) {}
>
> This was something previously raised by Michael on the llvm-dev thread.


Yes, it is possible with FP SCEV. I implemented fp-range and backedge taken count calculation, but I don't want to put everything in this patch.
Community should also decide about the flag, whether it will be "-ffast-math" or something else.


Repository:
  rL LLVM

http://reviews.llvm.org/D20695





More information about the llvm-commits mailing list