This is an archive of the discontinued LLVM Phabricator instance.

[mlir] support external named transform libraries
ClosedPublic

Authored by ftynse on Mar 27 2023, 7:06 AM.

Details

Summary

Introduce support for external definitions of named sequences in the
transform dialect by letting the TransformInterpreterPassBase read a
"library" MLIR file. This file is expected to contain definitions for
named sequences that are only declared in the main transformation
script. This allows for sharing non-trivial transform combinations
without duplication.

This patch provides only the minimal plumbing for a single textual IR
file. Further changes are possible to support multiple libraries and
bytecode files.

Diff Detail

Event Timeline

ftynse created this revision.Mar 27 2023, 7:06 AM
ftynse requested review of this revision.Mar 27 2023, 7:06 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 27 2023, 7:06 AM
nicolasvasilache accepted this revision.Mar 27 2023, 9:07 AM

LGTM, thanks!

mlir/lib/Dialect/Transform/IR/TransformOps.cpp
792–793

DCE?

This revision is now accepted and ready to land.Mar 27 2023, 9:07 AM
ftynse updated this revision to Diff 508935.Mar 28 2023, 2:18 AM

Address review

ftynse marked an inline comment as done.Mar 28 2023, 2:23 AM
This revision was landed with ongoing or failed builds.Mar 28 2023, 2:47 AM
This revision was automatically updated to reflect the committed changes.

I think this is breaking CI.

INFO: From Testing @llvm-project//mlir/test/Dialect:SCF/one-shot-bufferize.mlir.test:
==================== Test output for @llvm-project//mlir/test/Dialect:SCF/one-shot-bufferize.mlir.test:
lit.py: /var/lib/buildkite-agent/builds/llvm-bazel-premerge-buildkite-2-3/llvm-project/premerge-checks/llvm/utils/lit/lit/llvm/subst.py:122: note: Did not find mlir-tblgen in external/llvm-project/mlir:external/llvm-project/llvm

(Temporary) CI log: https://buildkite.com/llvm-project/premerge-checks/builds/143762#018729e9-79e6-4916-a163-e1908bb9fdc2

I think this is breaking CI.

INFO: From Testing @llvm-project//mlir/test/Dialect:SCF/one-shot-bufferize.mlir.test:
==================== Test output for @llvm-project//mlir/test/Dialect:SCF/one-shot-bufferize.mlir.test:
lit.py: /var/lib/buildkite-agent/builds/llvm-bazel-premerge-buildkite-2-3/llvm-project/premerge-checks/llvm/utils/lit/lit/llvm/subst.py:122: note: Did not find mlir-tblgen in external/llvm-project/mlir:external/llvm-project/llvm

(Temporary) CI log: https://buildkite.com/llvm-project/premerge-checks/builds/143762#018729e9-79e6-4916-a163-e1908bb9fdc2

Note that the Bazel CI is not officially maintained, so in general it isn't the responsibility of the community to maintain it. That said @ftynse has opted in to the Bazel phab project and maintenance of the Bazel build (one of the many perks of working at Google 😛). @ftynse, it looks like this failed on presubmit as well: https://buildkite.com/llvm-project/premerge-checks/builds/143452#01872366-31f6-4d33-b73f-89cbb9af50f3, including the build that finished before review and submission: https://buildkite.com/llvm-project/premerge-checks/builds/143452#01872366-31f6-4d33-b73f-89cbb9af50f3. Could you please make sure not to commit things that break the Bazel build?

Has this failure been clearly root-caused to this patch? Because I have really hard time seeing how SCF bufferization tests are related to this change.