[MLIR][SPIRV] Start module combiner.
authorergawy <kareem.ergawy@gmail.com>
Fri, 30 Oct 2020 18:36:19 +0000 (14:36 -0400)
committerLei Zhang <antiagainst@google.com>
Fri, 30 Oct 2020 20:55:43 +0000 (16:55 -0400)
commit90a8260cb46dbf15b6c2325979273da6d15e9aee
tree712d06e567ec9d766a40a827ee4d5d8bd6d6b58e
parent30e130c3edb2381ac099556d4976f379dfaa4f66
[MLIR][SPIRV] Start module combiner.

This commit adds a new library that merges/combines a number of spv
modules into a combined one. The library has a single entry point:
combine(...).

To combine a number of MLIR spv modules, we move all the module-level ops
from all the input modules into one big combined module. To that end, the
combination process can proceed in 2 phases:

  (1) resolving conflicts between pairs of ops from different modules
  (2) deduplicate equivalent ops/sub-ops in the merged module. (TODO)

This patch implements only the first phase.

Reviewed By: antiagainst

Differential Revision: https://reviews.llvm.org/D90477
mlir/include/mlir/Dialect/SPIRV/ModuleCombiner.h [new file with mode: 0644]
mlir/lib/Dialect/SPIRV/CMakeLists.txt
mlir/lib/Dialect/SPIRV/Linking/CMakeLists.txt [new file with mode: 0644]
mlir/lib/Dialect/SPIRV/Linking/ModuleCombiner/CMakeLists.txt [new file with mode: 0644]
mlir/lib/Dialect/SPIRV/Linking/ModuleCombiner/ModuleCombiner.cpp [new file with mode: 0644]
mlir/test/Dialect/SPIRV/Linking/ModuleCombiner/basic.mlir [new file with mode: 0644]
mlir/test/Dialect/SPIRV/Linking/ModuleCombiner/conflict_resolution.mlir [new file with mode: 0644]
mlir/test/lib/Dialect/SPIRV/CMakeLists.txt
mlir/test/lib/Dialect/SPIRV/TestModuleCombiner.cpp [new file with mode: 0644]
mlir/tools/mlir-opt/mlir-opt.cpp