Transform interfaces are implemented, direction or via extensions, in libraries belonging to multiple other dialects. Those dialects don't need to depend on the non-interface part of the transform dialect, which includes the growing number of ops and transitive dependency footprint. Split out the interfaces into a separate library. This in turn requires flipping the dependency from the interface on the dialect that has crept in because both co-existed in one library. The interface shouldn't depend on the transform dialect either. As a consequence of splitting, the capability of the interpreter to automatically walk the payload IR to identify payload ops of a certain kind based on the type used for the entry point symbol argument is disabled. This is a good move by itself as it simplifies the interpreter logic. This functionality can be trivially replaced by a `transform.structured.match` operation.
41 lines
1.3 KiB
C++
41 lines
1.3 KiB
C++
//===- TestTransformStateExtension.h - Test Utility -------------*- C++ -*-===//
|
|
//
|
|
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
|
// See https://llvm.org/LICENSE.txt for license information.
|
|
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
//
|
|
// This file defines an TransformState extension for the purpose of testing the
|
|
// relevant APIs.
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
#ifndef MLIR_TEST_LIB_DIALECT_TRANSFORM_TESTTRANSFORMSTATEEXTENSION_H
|
|
#define MLIR_TEST_LIB_DIALECT_TRANSFORM_TESTTRANSFORMSTATEEXTENSION_H
|
|
|
|
#include "mlir/Dialect/Transform/Interfaces/TransformInterfaces.h"
|
|
|
|
using namespace mlir;
|
|
|
|
namespace mlir {
|
|
namespace test {
|
|
class TestTransformStateExtension
|
|
: public transform::TransformState::Extension {
|
|
public:
|
|
TestTransformStateExtension(transform::TransformState &state,
|
|
StringAttr message)
|
|
: Extension(state), message(message) {}
|
|
|
|
StringRef getMessage() const { return message.getValue(); }
|
|
|
|
LogicalResult updateMapping(Operation *previous, Operation *updated);
|
|
|
|
private:
|
|
StringAttr message;
|
|
};
|
|
} // namespace test
|
|
} // namespace mlir
|
|
|
|
#endif // MLIR_TEST_LIB_DIALECT_TRANSFORM_TESTTRANSFORMSTATEEXTENSION_H
|