1 2//===- TransformEffect.td - Transform side effects ---------*- tablegen -*-===// 3// 4// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 5// See https://llvm.org/LICENSE.txt for license information. 6// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 7// 8//===----------------------------------------------------------------------===// 9// 10// This file defines side effects and associated resources for operations in the 11// Transform dialect and extensions. 12// 13//===----------------------------------------------------------------------===// 14 15#ifndef MLIR_DIALECT_TRANSFORM_IR_TRANSFORM_EFFECTS_TD 16#define MLIR_DIALECT_TRANSFORM_IR_TRANSFORM_EFFECTS_TD 17 18include "mlir/Interfaces/SideEffectInterfaces.td" 19 20//===----------------------------------------------------------------------===// 21// Effects on the mapping between Transform IR values and Payload IR ops. 22//===----------------------------------------------------------------------===// 23 24// Side effect resource corresponding to the mapping between transform IR values 25// and Payload IR operations. 26def TransformMappingResource 27 : Resource<"::mlir::transform::TransformMappingResource">; 28 29// Describes the creation of a new entry in the transform mapping. Should be 30// accompanied by the Write effect as the entry is immediately initialized by 31// any reasonable transform operation. 32def TransformMappingAlloc : MemAlloc<TransformMappingResource>; 33 34// Describes the removal of an entry in the transform mapping. Typically 35// accompanied by the Read effect. 36def TransformMappingFree : MemFree<TransformMappingResource>; 37 38// Describes the access to the mapping. Read-only accesses can be reordered. 39def TransformMappingRead : MemRead<TransformMappingResource>; 40 41// Describes a modification of an existing entry in the mapping. It is rarely 42// used alone, and is mostly accompanied by the Allocate effect. 43def TransformMappingWrite : MemWrite<TransformMappingResource>; 44 45//===----------------------------------------------------------------------===// 46// Effects on Payload IR. 47//===----------------------------------------------------------------------===// 48 49// Side effect resource corresponding to the Payload IR itself. 50def PayloadIRResource : Resource<"::mlir::transform::PayloadIRResource">; 51 52// Corresponds to the read-only access to the Payload IR through some operation 53// handles in the Transform IR. 54def PayloadIRRead : MemRead<PayloadIRResource>; 55 56// Corresponds to the mutation of the Payload IR through an operation handle in 57// the Transform IR. Should be accompanied by the Read effect for most transform 58// operations (only a complete overwrite of the root op of the Payload IR is a 59// write-only modification). 60def PayloadIRWrite : MemWrite<PayloadIRResource>; 61 62#endif // MLIR_DIALECT_TRANSFORM_IR_TRANSFORM_EFFECTS_TD 63