[Scalarizer] Fix for vector bitcasts of different element numbers
When scalarizing bitcasts ScalarizerVisitor::visitBitCastInst divide the
input in three different cases:
- same number of elements before and after
- more elements after
- less elements after
For the first case there is no problem, but for 2) the code only really
worked if we had the case
<M x t1> -> <N*M x t2>
Similarly for 3), the code only made sense for
<N*M x t1> -> <M x t2>
So e.g. if we get a bitcast like
%bc94 = bitcast <6 x i64> %wide.vec to <8 x i48>, !dbg !157
ScalarizerVisitor::visitBitCastInst crashes with
opt: ../lib/IR/Instructions.cpp:3447: static llvm::CastInst *llvm::CastInst::Create(Instruction::CastOps, llvm::Value *, llvm::Type *, const llvm::Twine &, llvm::Instruction *): Assertion `castIsValid(op, S, Ty) && "Invalid cast!"' failed.
With this patch, we now make the scalarizer just leave such a bitcast since
it's totally unclear what we should do with it anyway.
ScalarizerVisitor::visitBitCastInst already returned early for
non-FixedVectorType type vectors.