assert in InnerLoopVectorizer::createEmptyLoop

I am seeing an assert when I compile the attached program with clang:

$ clang -fno-strict-aliasing -target mips64el-unknown-linux -O3 -fomit-frame-pointer -S test1.c -o test1.ll -emit-llvm

It asserts when LoopVectorize.cpp:506 is executed. It looks like it is complaining because it is trying to zero-extend an i64 (type Count->getType() returns i64) to an i32 (IdxTy).

if (Count->getType() != IdxTy) {
// The exit count can be of pointer type. Convert it to the correct
// integer type.
if (ExitCount->getType()->isPointerTy())
Count = CastInst::CreatePointerCast(Count, IdxTy, “”, Loc);
Count = CastInst::CreateZExtOrBitCast(Count, IdxTy, “zext.cnt”, Loc); // <= this line

test1.c (504 Bytes)

Please file a bug for these types of issues.

I filed a bug (14692). Please take a look.