[LLVMdev] Making GEP into vector illegal?

Chris Lattner clattner at apple.com
Tue Oct 14 17:40:05 PDT 2008


On Oct 14, 2008, at 1:34 PM, Daniel M Gessel wrote:

> In Joe programmer language (i.e. C ;) ), are we basically talking
> about disallowing:
>
> float4 a;
> float* ptr_z = &a.z;
>
> ?
>
> Won't programmers just resort to:
>
> float4 a;
> float* ptr_z = (float*)(&a) + 3;

This discussion is specifically about how to model this stuff in the  
LLVM IR, not whether a specific language accepts it.  As Eli mentions,  
no current llvm front-end supports that.  However, even if there was  
one that did, we could model this even if the change happens, so  
nothing is lost.

-Chris




More information about the llvm-dev mailing list