This is an archive of the discontinued LLVM Phabricator instance.

[mlir][linalg][bufferize] Move BufferizableOpInterface implementations
ClosedPublic

Authored by springerm on Oct 31 2021, 5:12 PM.

Details

Summary

This commit moves parts of the existing bufferization code into external op interface implementations. Furthermore, Comprehensive Bufferize is adapted to use the new interface.

Future commits will decouple the interface and its op implementations from Comprehensive Bufferize and the Linalg dialect, as well as split them into multiple files with their own build targets. This commit leaves the file structure and build rules mostly unchanged.

Depends On D112974

Diff Detail

Event Timeline

springerm created this revision.Oct 31 2021, 5:12 PM
springerm requested review of this revision.Oct 31 2021, 5:12 PM
springerm edited the summary of this revision. (Show Details)Nov 1 2021, 5:43 PM
springerm retitled this revision from [mlir][linalg][bufferize] Add BufferizableOpInterface to [mlir][linalg][bufferize] Move BufferizableOpInterface implementations.
springerm edited the summary of this revision. (Show Details)
nicolasvasilache accepted this revision.Nov 2 2021, 1:57 AM
This revision is now accepted and ready to land.Nov 2 2021, 1:57 AM
This revision was landed with ongoing or failed builds.Nov 2 2021, 2:36 AM
This revision was automatically updated to reflect the committed changes.
cchen15 added a subscriber: cchen15.Nov 2 2021, 9:07 AM

@springerm: It appears that this commit breaks the Windows build. Could you please take a look at this? Thanks!

[5917/7338] Linking CXX executable bin\mlir-capi-pass-test.exe
FAILED: bin/mlir-capi-pass-test.exe
cmd.exe /C "cd . && C:\ics\itools\pkgtools\cmake\v_3_15_5\efi2_win64\bin\cmake.exe -E vs_link_exe --intdir=tools\mlir\test\CAPI\CMakeFiles\mlir-capi-pass-test.dir --rc=C:\PROGRA~2\WI3CF2~1\10\bin\100190~1.0\x64\rc.exe --mt=C:\PROGRA~2\WI3CF2~1\10\bin\100190~1.0\x64\mt.exe --manifests  -- C:\PROGRA~2\MIB055~1\2019\PROFES~1\VC\Tools\MSVC\14.29.30133\bin\Hostx64\x64\link.exe /nologo @CMakeFiles\mlir-capi-pass-test.rsp  /out:bin\mlir-capi-pass-test.exe /implib:lib\mlir-capi-pass-test.lib /pdb:bin\mlir-capi-pass-test.pdb /version:0.0  /machine:x64 /STACK:10000000 /INCREMENTAL:NO /subsystem:console  && cd ."
LINK: command "C:\PROGRA~2\MIB055~1\2019\PROFES~1\VC\Tools\MSVC\14.29.30133\bin\Hostx64\x64\link.exe /nologo @CMakeFiles\mlir-capi-pass-test.rsp /out:bin\mlir-capi-pass-test.exe /implib:lib\mlir-capi-pass-test.lib /pdb:bin\mlir-capi-pass-test.pdb /version:0.0 /machine:x64 /STACK:10000000 /INCREMENTAL:NO /subsystem:console /MANIFEST /MANIFESTFILE:bin\mlir-capi-pass-test.exe.manifest" failed (exit code 1120) with the following output:
MLIRLinalgTransforms.lib(ComprehensiveBufferize.cpp.obj) : error LNK2019: unresolved external symbol "public: struct mlir::LogicalResult __cdecl mlir::linalg::BufferizableOpInterface::bufferize(class mlir::OpBuilder &,class mlir::BlockAndValueMapping &,class mlir::linalg::BufferizationAliasInfo &,struct mlir::linalg::AllocationCallbacks &)" (?bufferize@BufferizableOpInterface@linalg@mlir@@QEAA?AULogicalResult@3@AEAVOpBuilder@3@AEAVBlockAndValueMapping@3@AEAVBufferizationAliasInfo@23@AEAUAllocationCallbacks@23@@Z) referenced in function "struct mlir::LogicalResult __cdecl mlir::linalg::bufferizeOp(class mlir::Operation *,class mlir::BlockAndValueMapping &,class mlir::linalg::BufferizationAliasInfo &,struct mlir::linalg::AllocationCallbacks,class llvm::DenseMap<class mlir::FuncOp,class mlir::FunctionType,struct llvm::DenseMapInfo<class mlir::FuncOp>,struct llvm::detail::DenseMapPair<class mlir::FuncOp,class mlir::FunctionType> > *)" (?bufferizeOp@linalg@mlir@@YA?AULogicalResult@2@PEAVOperation@2@AEAVBlockAndValueMapping@2@AEAVBufferizationAliasInfo@12@UAllocationCallbacks@12@PEAV?$DenseMap@VFuncOp@mlir@@VFunctionType@2@U?$DenseMapInfo@VFuncOp@mlir@@@llvm@@U?$DenseMapPair@VFuncOp@mlir@@VFunctionType@2@@detail@5@@llvm@@@Z)
bin\mlir-capi-pass-test.exe : fatal error LNK1120: 1 unresolved externals