[Mlir-commits] [mlir] d52ec1e - [MLIR][NFC] fix msvc debug build errors (#131393)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Fri Mar 14 18:36:56 PDT 2025


Author: Bangtian Liu
Date: 2025-03-14T21:36:53-04:00
New Revision: d52ec1e9ddc630ed6567017e72ad98657a6b5e40

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

LOG: [MLIR][NFC] fix msvc debug build errors (#131393)

We found the build broken using msvc debug build as below:
```
C:\Users\bangtliu\iree\third_party\llvm-project\llvm\include\llvm/ADT/SmallVector.h(1162): error C2338: static_assert failed: 'You are trying to use a default number of inlined elements for `SmallVector<T>` but `sizeof(T)` is really big! Please use an explicit number of inlined elements with `SmallVector<T, N>` to make sure you really want that much inline storage.'
C:\Users\bangtliu\iree\third_party\llvm-project\llvm\include\llvm/ADT/SmallVector.h(1162): note: the template instantiation context (the oldest one first) is
C:\Users\bangtliu\iree\third_party\llvm-project\llvm\include\llvm/ADT/SmallVector.h(1194): note: see reference to class template instantiation 'llvm::CalculateSmallVectorDefaultInlinedElements<T>' being compiled
        with
        [
            T=`anonymous-namespace'::LinalgOperandDef
        ]
C:\Users\bangtliu\iree\third_party\llvm-project\mlir\tools\mlir-linalg-ods-gen\mlir-linalg-ods-yaml-gen.cpp(120): error C2976: 'llvm::SmallVector': too few template arguments
C:\Users\bangtliu\iree\third_party\llvm-project\llvm\include\llvm/ADT/SmallVector.h(1195): note: see declaration of 'llvm::SmallVector'
[862/7776] Building CXX object llvm-project\lib\DebugInfo\DWARF\CMakeFiles\LLVMDebugInfoDWARF.dir\DWARFDebugLine.cpp.obj
ninja: build stopped: subcommand failed.
```

This PR is added to address this error.

Added: 
    

Modified: 
    mlir/tools/mlir-linalg-ods-gen/mlir-linalg-ods-yaml-gen.cpp

Removed: 
    


################################################################################
diff  --git a/mlir/tools/mlir-linalg-ods-gen/mlir-linalg-ods-yaml-gen.cpp b/mlir/tools/mlir-linalg-ods-gen/mlir-linalg-ods-yaml-gen.cpp
index 80d979864921d..93a300e0b24a2 100644
--- a/mlir/tools/mlir-linalg-ods-gen/mlir-linalg-ods-yaml-gen.cpp
+++ b/mlir/tools/mlir-linalg-ods-gen/mlir-linalg-ods-yaml-gen.cpp
@@ -117,9 +117,9 @@ struct ScalarAssign {
 };
 
 struct LinalgStructuredOpConfig {
-  SmallVector<LinalgOperandDef> args;
+  SmallVector<LinalgOperandDef, 4> args;
   LinalgIndexingMapsConfig indexingMaps;
-  SmallVector<LinalgIteratorTypeDef> iteratorTypes;
+  SmallVector<LinalgIteratorTypeDef, 4> iteratorTypes;
   std::vector<ScalarAssign> assignments;
 };
 


        


More information about the Mlir-commits mailing list