[mlir] Use llvm::ElementCount when constructing an llvm splat vector.

This fixes a breakage after the LLVM API changed.
This commit is contained in:
River Riddle 2020-03-12 14:22:00 -07:00
parent 0ddba0bd59
commit 396a42d924
1 changed files with 2 additions and 1 deletions

View File

@ -113,7 +113,8 @@ llvm::Constant *ModuleTranslation::getLLVMConstant(llvm::Type *llvmType,
if (!child)
return nullptr;
if (llvmType->isVectorTy())
return llvm::ConstantVector::getSplat(numElements, child);
return llvm::ConstantVector::getSplat(
llvm::ElementCount(numElements, /*Scalable=*/false), child);
if (llvmType->isArrayTy()) {
auto arrayType = llvm::ArrayType::get(elementType, numElements);
SmallVector<llvm::Constant *, 8> constants(numElements, child);