[all-commits] [llvm/llvm-project] 787689: [mlir][transform] Fix handling of transitive inclu...
Ingo Müller via All-commits
all-commits at lists.llvm.org
Fri Oct 6 01:57:10 PDT 2023
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 787689943d027b062274f22097e7f30b0a52bd5b
https://github.com/llvm/llvm-project/commit/787689943d027b062274f22097e7f30b0a52bd5b
Author: Ingo Müller <ingomueller at google.com>
Date: 2023-10-06 (Fri, 06 Oct 2023)
Changed paths:
M mlir/include/mlir/Dialect/Transform/IR/TransformDialect.td
M mlir/include/mlir/Dialect/Transform/Transforms/TransformInterpreterPassBase.h
M mlir/include/mlir/IR/SymbolTable.h
M mlir/lib/Dialect/Transform/Transforms/TransformInterpreterPassBase.cpp
M mlir/lib/IR/SymbolTable.cpp
M mlir/test/Dialect/Transform/test-interpreter-external-symbol-decl-and-schedule.mlir
M mlir/test/Dialect/Transform/test-interpreter-external-symbol-decl-invalid.mlir
M mlir/test/Dialect/Transform/test-interpreter-external-symbol-decl.mlir
A mlir/test/Dialect/Transform/test-interpreter-external-symbol-def-invalid.mlir
M mlir/test/Dialect/Transform/test-interpreter-external-symbol-def.mlir
M mlir/test/lib/Dialect/Transform/TestTransformDialectInterpreter.cpp
Log Message:
-----------
[mlir][transform] Fix handling of transitive include in interpreter. (#67560)
Until now, the interpreter would only load those symbols from the
provided library files that were declared in the main transform module.
However, sequences in the library may include other sequences on their
own. Until now, if such sequences were not *also* declared in the main
transform module, the interpreter would fail to resolve them. Forward
declaring all of them is undesirable as it defeats the purpose of
encapsulation into library modules.
This PR implements a kind of linker for transform scripts to solve this
problem. The linker merges all symbols of the library module into the
main module before interpreting the latter. Symbols whose names collide
are handled as follows: (1) if they are both functions (in the sense of
`FunctionOpInterface`) with compatible signatures, one is external, and
the other one is public, then they are merged; (2) of one of them is
private, that one is renamed; and (3) an error is raised otherwise.
One consequence of this change is that the loading of the library files
in the interpreter pass is not idempotent anymore, i.e., subsequent
interpreter passes cannot (and need not) load the same library files again
since would lead to doubly defined symbols.
More information about the All-commits
mailing list