[llvm-commits] [llvm] r69574 - /llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp

Duncan Sands baldrick at free.fr
Tue Apr 21 00:52:18 PDT 2009


Hi Sanjiv,

> >>>> Before trying to introduce/eliminate cast/ext/trunc to make indices type as
> >>>> pointer type, make sure that the pointer size is a valid sequential index type.
> >>>>         
> >
> > I think a better approach would be to add a "get preferred type for GEP indices"
> > method to TargetData.  This would return getIntPtrType on most targets, and i16
> > on PIC16.  Then change this transform to use the type given by that method rather
> > than getIntPtrType.
> >   
> I think you meant i32 on PIC16, because i16 indices are still not 
> allowed to GEP.

sure, if that's what PIC16 wants.  Anyway, the point is to decouple the GEP index
type from pointer types in a clean way, by introducing new abstractions.

Ciao,

Duncan.



More information about the llvm-commits mailing list