[Mlir-commits] [mlir] 396a42d - [mlir] Use llvm::ElementCount when constructing an llvm splat vector.

River Riddle llvmlistbot at llvm.org
Thu Mar 12 14:28:03 PDT 2020


Author: River Riddle
Date: 2020-03-12T14:26:15-07:00
New Revision: 396a42d924de7e23a23b576937579f26ff826124

URL: https://github.com/llvm/llvm-project/commit/396a42d924de7e23a23b576937579f26ff826124
DIFF: https://github.com/llvm/llvm-project/commit/396a42d924de7e23a23b576937579f26ff826124.diff

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

This fixes a breakage after the LLVM API changed.

Added: 
    

Modified: 
    mlir/lib/Target/LLVMIR/ModuleTranslation.cpp

Removed: 
    


################################################################################
diff  --git a/mlir/lib/Target/LLVMIR/ModuleTranslation.cpp b/mlir/lib/Target/LLVMIR/ModuleTranslation.cpp
index 15a4f3bd4772..11078e7fa52a 100644
--- a/mlir/lib/Target/LLVMIR/ModuleTranslation.cpp
+++ b/mlir/lib/Target/LLVMIR/ModuleTranslation.cpp
@@ -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);


        


More information about the Mlir-commits mailing list