blob: 718ab95c4bab0c885768f9004370e61998c0b599 [file] [edit]
//===- TestPDLL.pdll - Test PDLL functionality ----------------------------===//
//
// 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 "TestOps.td"
#include "mlir/Interfaces/CastInterfaces.td"
Constraint TestConstraintWithNamedOpOperand(testOp: Op<test.op_a>) [{
return success();
}];
/// A simple pattern that matches and replaces an operation.
Pattern TestSimplePattern => replace op<test.simple> with op<test.success>;
// Test the import of interfaces.
Pattern TestInterface => replace _: CastOpInterface with op<test.success>;
// Test application of constraint.
Pattern {
let op = op<test.op_a>(input: Value);
TestConstraintWithNamedOpOperand(op);
replace op with op<test.success>;
}