[llvm-dev] ScalarEvolution "add nsw" question

Johannes Doerfert via llvm-dev llvm-dev at lists.llvm.org
Tue Apr 12 12:57:38 PDT 2016


Hi Bjarke,

Thanks for your response. I agree that Sanjoy's email already answered
my question. To be honest, I am not 100% sure about the loop code and
the consequences but that doesn't matter to much at the moment. What
matters is that I have made progress on explaining the mismatch between
the ScalarEvolution results and what I would have expected, or better,
liked. At the moment I think that the context in-sensitivity of
ScalarEvolution is what is preventing me from the results I would like
to see. Therefor, I have to look at the IR during Polly's context
sensitive analysis/modeling step. As our "context" includes information
about possibly "non-returning function calls", infinite loops, etc. I
think that should allow to get precise but also sound results.

Thank you both again,
  Johannes

On 04/12, 'Bjarke Roune' via Polly Development wrote:
> Hi Johannes,
> 
> Sanjoy has given you great information already.
> 
> On Sun, Apr 10, 2016 at 5:19 PM, Sanjoy Das <sanjoy at playingwithpointers.com>
> wrote:
> 
> > Johannes Doerfert wrote:
> > > Is there any plan to use e.g., post-dominance information to
> > > propagate wrapping flags?
> >
> > None that I'm aware of.
> >
> > > If x +nsw y post-dominates the entry block
> > > [and is used in some side-effect instruction] the SCEV could be marked
> > > as non-wrapping, couldn't it?
> >
> > Yes, but we have to be careful to account for exceptions, infinitely
> > looping functions, exit(0) etc.  I.e. in
> >
> > void foo() {
> >   use(x + y);
> >   exit(0);
> >   use(x +nsw y);
> > }
> >
> > the nsw in the later x+y cannot be transferred to the former x+y
> > (assume use is a side effecting use).
> >
> > The code I wrote to handle this could be made more powerful, e.g. by
> introducing an analysis pass for strong post-dominance (as opposed to the
> usual kind of post-dominance). There was a brief amount of discussion on
> this a while back:
> 
>   https://groups.google.com/forum/#!topic/llvm-dev/CBJY51__wOE
> 
> I don't know if there's been any developments on that since then.
> 
> Bjarke
> 
> -- 
> You received this message because you are subscribed to the Google Groups "Polly Development" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to polly-dev+unsubscribe at googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 

Johannes Doerfert
Researcher / PhD Student

Compiler Design Lab (Prof. Hack)
Saarland University, Computer Science
Building E1.3, Room 4.31

Tel. +49 (0)681 302-57521 : doerfert at cs.uni-saarland.de
Fax. +49 (0)681 302-3065  : http://www.cdl.uni-saarland.de/people/doerfert
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 213 bytes
Desc: Digital signature
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20160412/d0bacbb5/attachment.sig>


More information about the llvm-dev mailing list