Rolf Morel db7888ca9a
[MLIR][Transform] Introduce transform.tune.knob op (#146732)
A new transform op to represent that an attribute is to be chosen from a
set of alternatives and that this choice is made available as a
`!transform.param`. When a `selected` argument is provided, the op's
`apply()` semantics is that of just making this selected attribute
available as the result. When `selected` is not provided, `apply()`
complains that nothing has resolved the non-determinism that the op is
representing.
2025-07-08 11:00:34 +01:00

33 lines
1.0 KiB
C++

//===- TuneExtension.cpp - Tune extension for the Transform dialect -------===//
//
// 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
//
//===----------------------------------------------------------------------===//
#include "mlir/Dialect/Transform/TuneExtension/TuneExtension.h"
#include "mlir/Dialect/Transform/IR/TransformDialect.h"
#include "mlir/Dialect/Transform/TuneExtension/TuneExtensionOps.h"
#include "mlir/IR/DialectRegistry.h"
using namespace mlir;
class TuneExtension
: public transform::TransformDialectExtension<TuneExtension> {
public:
MLIR_DEFINE_EXPLICIT_INTERNAL_INLINE_TYPE_ID(TuneExtension)
void init() {
registerTransformOps<
#define GET_OP_LIST
#include "mlir/Dialect/Transform/TuneExtension/TuneExtensionOps.cpp.inc"
>();
}
};
void mlir::transform::registerTuneExtension(DialectRegistry &dialectRegistry) {
dialectRegistry.addExtensions<TuneExtension>();
}