The patch extends the yaml code generation to support the following new OpDSL constructs:
- captures
- constants
- iteration index accesses
- predefined types
These changes have been introduced by revision
https://reviews.llvm.org/D101364.
Differential D102075
[mir][Python][linalg] Support OpDSL extensions in C++. gysit on May 7 2021, 8:14 AM. Authored by
Details The patch extends the yaml code generation to support the following new OpDSL constructs:
These changes have been introduced by revision
Diff Detail
Event TimelineComment Actions I decided to add the following tests:
Comment Actions This has come along nicely since we looked at it together - thank you for spending the time on adding an additional layer of testing. Code lgtm - I'll leave to Nicolas wrt details of Linalg parse/print/etc.
Comment Actions This revision does a little too much for my taste. Still, I think at least the captures should be separated out because it does increase the semantic power of linalg ops irrespective of opdsl. In any case let's iterate Monday on VC. Thanks!
Comment Actions I believe this change causes the assert on the attribute SmallVector (for size >256) to hit when the size isn't specified on Windows debug builds. [4242/5334] Building CXX object tools\mlir\tools\mlir-linalg-ods-gen\CMakeFiles\mlir-linalg-ods-yaml-gen.dir\mlir-linalg-ods-yaml-gen.cpp.obj FAILED: tools/mlir/tools/mlir-linalg-ods-gen/CMakeFiles/mlir-linalg-ods-yaml-gen.dir/mlir-linalg-ods-yaml-gen.cpp.obj C:\PROGRA~2\MICROS~3\2019\COMMUN~1\VC\Tools\MSVC\1428~1.299\bin\Hostx64\x64\cl.exe /nologo /TP -DGTEST_HAS_RTTI=0 -DMLIR_CUDA_CONVERSIONS_ENABLED=0 -DMLIR_ROCM_CONVERSIONS_ENABLED=0 -DUNICODE -D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_NONSTDC_NO_WARNINGS -D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS -D_HAS_EXCEPTIONS=0 -D_SCL_SECURE_NO_DEPRECATE -D_SCL_SECURE_NO_WARNINGS -D_UNICODE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -Itools\mlir\tools\mlir-linalg-ods-gen -IC:\vsts-agent\_work\13\s\mlir\tools\mlir-linalg-ods-gen -Iinclude -IC:\vsts-agent\_work\13\s\llvm\include -IC:\vsts-agent\_work\13\s\mlir\include -Itools\mlir\include /DWIN32 /D_WINDOWS /Zc:inline /Zc:__cplusplus /Zc:strictStrings /Oi /Zc:rvalueCast /bigobj /W4 -wd4141 -wd4146 -wd4244 -wd4267 -wd4291 -wd4351 -wd4456 -wd4457 -wd4458 -wd4459 -wd4503 -wd4624 -wd4722 -wd4100 -wd4127 -wd4512 -wd4505 -wd4610 -wd4510 -wd4702 -wd4245 -wd4706 -wd4310 -wd4701 -wd4703 -wd4389 -wd4611 -wd4805 -wd4204 -wd4577 -wd4091 -wd4592 -wd4319 -wd4709 -wd4324 -w14062 -we4238 /MDd /Zi /Ob0 /Od /RTC1 /EHs-c- /GR- /EHs-c- /GR- -std:c++14 /showIncludes /Fotools\mlir\tools\mlir-linalg-ods-gen\CMakeFiles\mlir-linalg-ods-yaml-gen.dir\mlir-linalg-ods-yaml-gen.cpp.obj /Fdtools\mlir\tools\mlir-linalg-ods-gen\CMakeFiles\mlir-linalg-ods-yaml-gen.dir\ /FS -c C:\vsts-agent\_work\13\s\mlir\tools\mlir-linalg-ods-gen\mlir-linalg-ods-yaml-gen.cpp C:\vsts-agent\_work\13\s\llvm\include\llvm/ADT/SmallVector.h(1135): error C2338: 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:\vsts-agent\_work\13\s\mlir\tools\mlir-linalg-ods-gen\mlir-linalg-ods-yaml-gen.cpp(120): note: see reference to class template instantiation 'llvm::CalculateSmallVectorDefaultInlinedElements<T>' being compiled with [ T=`anonymous-namespace'::ScalarAssign ] C:\vsts-agent\_work\13\s\mlir\tools\mlir-linalg-ods-gen\mlir-linalg-ods-yaml-gen.cpp(120): error C2976: 'llvm::SmallVector': too few template arguments C:\vsts-agent\_work\13\s\llvm\include\llvm/ADT/SmallVector.h(1168): note: see declaration of 'llvm::SmallVector' Comment Actions @NathanielMcVicar Thanks for reporting this. I hope https://reviews.llvm.org/D102827 fixes your issue? |