Llvm support for non-power-of-2-sized vectors

Hi,

My target can support non-power-of-2-sized vectors. My first thought is to add the non-power-of-2 vector type to the function MVT::getVectorVT in MachineValueType.h, is this the correct approach?

I see code that checks for isPowOf2 for vectors in

lib/CodeGen/TargetLoweringBase.cpp


// FIXME: We don't support non-power-of-2-sized vectors for now.  Ideally we
  // could break down into LHS/RHS like LegalizeDAG does.
  if (!isPowerOf2_32(NumElts)) {
    NumVectorRegs = NumElts;
    NumElts = 1;
  }

Any suggestions on how to support non-power-of-2-sized vectors? Or maybe a workaround?

Thanks,
-Kevin