Skip to content

Commit

Permalink
[mlir] Use llvm::ElementCount when constructing an llvm splat vector.
Browse files Browse the repository at this point in the history
This fixes a breakage after the LLVM API changed.
  • Loading branch information
River707 committed Mar 12, 2020
1 parent 0ddba0b commit 396a42d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion mlir/lib/Target/LLVMIR/ModuleTranslation.cpp
Expand Up @@ -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);
Expand Down

0 comments on commit 396a42d

Please sign in to comment.