handle bitcast of i64 to <2 x i32>
diff --git a/lib/Transforms/NaCl/ExpandI64.cpp b/lib/Transforms/NaCl/ExpandI64.cpp index ca8ea0b..3d0d5c6 100644 --- a/lib/Transforms/NaCl/ExpandI64.cpp +++ b/lib/Transforms/NaCl/ExpandI64.cpp
@@ -831,6 +831,18 @@ Chunks.push_back(Ext); } break; + } else if (I->getOperand(0)->getType() == i64 && isa<VectorType>(I->getType())) { + // i64 to vector of two i32s + unsigned NumElts = getNumChunks(I->getType()); + assert(NumElts == 2); + Type *ElementType = cast<VectorType>(I->getType())->getElementType(); + assert(ElementType == i32); + ensureFuncs(); + ChunksVec InputChunks = getChunks(I->getOperand(0)); + Instruction *L = InsertElementInst::Create(Constant::getNullValue(I->getType()), InputChunks[0], ConstantInt::get(i32, 0), "lo-i642v", I); + Instruction *H = InsertElementInst::Create(L, InputChunks[1], ConstantInt::get(i32, 1), "hi-i642v", I); + I->replaceAllUsesWith(H); + break; } else { // no-op bitcast assert(I->getType() == I->getOperand(0)->getType());