[flang-commits] [flang] [mlir] [mlir] Align num elements type to LLVM ArrayType (PR #93230)

Tobias Gysi via flang-commits flang-commits at lists.llvm.org
Fri May 24 09:03:55 PDT 2024


================
@@ -632,7 +632,7 @@ llvm::Constant *mlir::LLVM::detail::getLLVMConstant(
           llvm::ElementCount::get(numElements, /*Scalable=*/isScalable), child);
     if (llvmType->isArrayTy()) {
       auto *arrayType = llvm::ArrayType::get(elementType, numElements);
-      SmallVector<llvm::Constant *, 8> constants(numElements, child);
+      std::vector<llvm::Constant *> constants(numElements, child);
       return llvm::ConstantArray::get(arrayType, constants);
----------------
gysit wrote:

Ah it pushes the integer to the `Elts` vector and not the Constant*. The integer is an i8 which is below 4 bytes so it uses a 64-bits size limit while for the Constant* the size is limited to 32-bits. I guess things would stop working if you use an i64 instead of an i8? 

https://github.com/llvm/llvm-project/pull/93230


More information about the flang-commits mailing list