[llvm-commits] [llvm] r91614 - in /llvm/trunk: include/llvm/CodeGen/ValueTypes.h lib/CodeGen/SelectionDAG/LegalizeDAG.cpp

Ken Dyck Ken.Dyck at onsemi.com
Wed Jan 6 08:14:38 PST 2010


 
On Wednesday, January 06, 2010 11:04 AM, Duncan Sands wrote:
> 
> >> Perhaps I'm misunderstanding, but with this approach, wouldn't a 
> >> store of i64 with an alignment of 2 expand to two i24 
> stores and one 
> >> i16 store since the largest legal type of alignment 2 is i24? 
> >> (Presumably the one unaligned i24 store would need to be further 
> >> expanded to an i16 and an
> >> i8 store).
> > 
> > yes, but that's correct!  Remember I'm talking about *legal* types 
> > here, not simple types.  If the processor supports i24 
> stores and i16 
> > stores, then storing two lots of i24 and one lot of i16 
> seems like a 
> > good thing to do.  Maybe it's best to check not that the type is 
> > legal, but that stores of the type are legal (since there 
> might be i24 
> > registers but no store operation for them).
> 
> I just realized that the second i24 store wouldn't be 
> aligned, so indeed something more sophisticated is needed here.

LegalizeOp() recursively calls itself on its result. Won't that cause
the unaligned i24 store to be expanded into an i16 and i8 store? 

-Ken




More information about the llvm-commits mailing list