[LLVMdev] c const

Gordon Henriksen gordonhenriksen at mac.com
Sun Aug 19 13:15:07 PDT 2007


On 2007-08-19, at 15:41, Duncan Sands wrote:

> can you please explain more about what restrict means: it may help  
> in improving code quality for Ada.  In Ada you have runtime  
> constants that are really constant, for example array bounds.  The  
> bounds are passed around by pointer, which causes LLVM to think  
> they may be aliased and changed by function calls (which is  
> impossible).  This results on rotten code since (for example) the  
> array length and bounds checks are recalculated again and again  
> when one calculation would do.  [The front-end outputs a bound  
> check for every array access, expecting the optimizers to remove  
> redundant checks, which LLVM often does not do].  If I could teach  
> LLVM that array bounds are really constant that would presumably  
> solve the problem.

Here's a thread about it:

http://lists.cs.uiuc.edu/pipermail/llvmdev/2007-March/thread.html#8291

I don't think anything has been implemented.

— Gordon

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20070819/9f106447/attachment.html>


More information about the llvm-dev mailing list