[LLVMdev] Another missed optimization opportunity?

Caldarale, Charles R Chuck.Caldarale at unisys.com
Wed Apr 24 13:35:39 PDT 2013


> From: llvmdev-bounces at cs.uiuc.edu [mailto:llvmdev-bounces at cs.uiuc.edu]
> On Behalf Of Scott Pakin
> Subject: Re: [LLVMdev] Another missed optimization opportunity?

> > Is this a potential aliasing effect?  Since myarray is defined as a 
> > pointer, not an array, it's theoretically possible that the address 
> > therein refers to the same memory location as the pointer itself.

> I was thinking along those lines, but I haven't been able to come up
> with a specific instance of what could possibly be aliased.

The myarray variable could be defined and initialized like this:

    int* myarray = ((int*)&myarray) - 5;

If the initialization occurs external to the module with the incrementation function, the optimizers must assume such silliness is possible in lieu of any information to the contrary, so aliasing can occur.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers.





More information about the llvm-dev mailing list