[LLVMdev] Iterator protocols

Joachim Durchholz jo at durchholz.org
Fri May 16 07:50:05 PDT 2008


Am Freitag, den 16.05.2008, 06:54 -0700 schrieb Chris Lattner:
> On May 13, 2008, at 4:09 PM, Gordon Henriksen wrote:
> 
> > On May 13, 2008, at 18:28, Dan Gohman wrote:
> >
> > I wonder if it would be worthwhile to have a flag on loads to mark
> > them as immutable. A flag from the source language stating "this load
> > never aliases any subsequent store." A majority of loads in functional
> > languages are of this nature. I could see a number of benefits:
> >
> > • Duplicate loads could be RAUW'd based solely on SSA properties.
> > • load / store alias analysis could be short-circuited for such loads.
> > • Codegen could remat such loads under register pressure.
> > • Vtable lookups through loop-invariant SSA vars could trivially be
> > shown to be themselves loop-invariant.
> 
> This is very interesting.  If there is a use-case that this sort of  
> thing would strongly benefit, then we could add it.

Any tight loop that uses a virtual function.
That's interesting for languages where functions are virtual by default.
(I think OO language designers tend to avoid nonvirtual functions in
general.)

Note that functional language tend to have the moral equivalent of
virtual functions, too, but I don't know how strong the effect would be.

Regards,
Jo




More information about the llvm-dev mailing list