[mlir] fix build after llvm made ElementCount constructor private
authorAlex Zinenko <zinenko@google.com>
Wed, 19 Aug 2020 16:46:53 +0000 (18:46 +0200)
committerAlex Zinenko <zinenko@google.com>
Wed, 19 Aug 2020 16:48:24 +0000 (18:48 +0200)
The original patch (264afb9e6aebc98c353644dd0700bec808501cab) did not
update subprojects.

mlir/lib/Dialect/LLVMIR/IR/LLVMTypes.cpp
mlir/lib/Target/LLVMIR/ModuleTranslation.cpp

index 727efbb..18008c6 100644 (file)
@@ -483,7 +483,7 @@ LLVMType LLVMVectorType::getElementType() {
 
 llvm::ElementCount LLVMVectorType::getElementCount() {
   // Both derived classes share the implementation type.
-  return llvm::ElementCount(
+  return llvm::ElementCount::get(
       static_cast<detail::LLVMTypeAndSizeStorage *>(impl)->numElements,
       isa<LLVMScalableVectorType>());
 }
index 21f5201..093a9e6 100644 (file)
@@ -141,7 +141,7 @@ llvm::Constant *ModuleTranslation::getLLVMConstant(llvm::Type *llvmType,
       return nullptr;
     if (llvmType->isVectorTy())
       return llvm::ConstantVector::getSplat(
-          llvm::ElementCount(numElements, /*Scalable=*/false), child);
+          llvm::ElementCount::get(numElements, /*Scalable=*/false), child);
     if (llvmType->isArrayTy()) {
       auto *arrayType = llvm::ArrayType::get(elementType, numElements);
       SmallVector<llvm::Constant *, 8> constants(numElements, child);