(original) (raw)

Vector promotion which is new in LLVM 3.1 is broken for sub32 bit types. The problem is in the VectorLegalizer::PromoteVectorOp.

The function getTypeToPromoteTo will return a <2 x i32> for a <2 x i8>, <2 x i16> or <4 x i8>. The problem is that there are no vectors of size 1 defined for i32 or i16\. The attached patch fixes these issues.

This can be reproduced by setting in any target:

setOperationAction(ISD::AND, MVT::i8, Promote);

setOperationAction(ISD::AND, MVT::v2i8, Promote);

setOperationAction(ISD::AND, MVT::i16, Promote);

Let me know if this is good,

Micah