[LLVMdev] Iterator protocols

Chris Lattner sabre at nondot.org
Fri May 16 07:55:46 PDT 2008


On May 16, 2008, at 7:50 AM, Joachim Durchholz wrote:

>
> 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.)

This isn't safe in C++ for example.

Also, the proposed definition wouldn't permit hoisting one of these  
loads out of a loop.

-Chris



More information about the llvm-dev mailing list