[CIL users] Olf vs. Golf [was: optimizations with pointers]

2009-09-09 Thread Christoph Spiel
On Wed, Sep 09, 2009 at 10:38:14AM -0400, Stephen Magill wrote: > I haven't tried this, but I suspect a pointer analysis could help you obtain > a more general solution. Take a look at ptranal.ml in the cil src/ext/pta > directory. The default pointer analysis module is Olf, because "ptra

Re: [CIL users] optimizations with pointers

2009-09-09 Thread John Regehr
> On a big tangent, has anyone ever been tempted to recast Cil's > analyses and optimizations in a composable framework, a la [1]? We did a bit of work in this direction: http://www.cs.utah.edu/~regehr/papers/lctes06_1/ http://www.cs.utah.edu/~coop/research/cxprop/ John Regehr ---

Re: [CIL users] optimizations with pointers

2009-09-09 Thread Benjamin Ylvisaker
I understand that _in general_ determining what a pointer points to at compile time is undecidable. I think what I want is a conservative points-to enhanced constant propagation (followed by dead code elimination to hopefully remove the address-of expression entirely). It sounds like I ca

Re: [CIL users] optimizations with pointers

2009-09-09 Thread Gabriel Kerneis
Hello, On Wed, Sep 09, 2009 at 05:39:46PM +0100, Alastair Reid wrote: > 1) Use a visitor to identify all variables whose address is taken. Cil does it for you. Cf. type varinfo, mutable vaddrof in the doc: http://hal.cs.berkeley.edu/cil/api/Cil.html#TYPEvarinfo Regards, -- Gabriel Kerneis

Re: [CIL users] optimizations with pointers

2009-09-09 Thread Alastair Reid
Hi, Just to add to the list of suggestions... I don't think there is a specific pass but, depending on your application, the following might work and is fairly simple. 1) Use a visitor to identify all variables whose address is taken. 2) Use a visitor to identify all variables which have precis

Re: [CIL users] optimizations with pointers

2009-09-09 Thread Stephen Magill
I haven't tried this, but I suspect a pointer analysis could help you obtain a more general solution. Take a look at ptranal.ml in the cil src/ext/pta directory. There will still be a lot of cases where this won't work though (due, as Gabriel pointed out, to the undecidability of the problem in g