[LLVMdev] C99 restrict

Chris Lattner sabre at nondot.org
Sun Mar 25 15:22:18 PDT 2007


On Sun, 25 Mar 2007, Christopher Lamb wrote:
>>  So far, there hasn't been a discussion.  IMO, the most important form is
>>  for formal arguments.  That could easily be added thorough the use of an
>>  attribute on the parameter.
>
> I assume the idea here is to avoid actually attributing the type (as was 
> avoided with signed/unsigned integers by differentiating ops).

Yep, exactly.

> What about an approach not unlike how debugging information is handled? That 
> is have an llvm intrinsic that encodes the known alias free range for a 
> pointer.

That is another great possibility.  One issue is that I haven't had time 
to study the implications of C99 restrict, so I don't feel qualified to 
propose a concrete solution yet.  Ideally, the mechanism added to LLVM 
would be able to handle restrict as well as fortran argument parameters 
(even if the fortran functions are inlined!), etc.  IOW, we don't want to 
have an feature that just implements C99 restrict, we want a more general 
mechanism which C99 restrict can be implemented in terms of.  It seems 
like an intrinsic would be a good way to do that.

-Chris

-- 
http://nondot.org/sabre/
http://llvm.org/



More information about the llvm-dev mailing list