[Mlir-commits] [mlir] [MLIR][OpenMP] Add a new ComposableOpInterface to check/set a composite unitAttr. (PR #102340)
Sergio Afonso
llvmlistbot at llvm.org
Thu Aug 8 02:35:38 PDT 2024
================
@@ -142,6 +142,42 @@ def LoopWrapperInterface : OpInterface<"LoopWrapperInterface"> {
];
}
+def ComposableOpInterface : OpInterface<"ComposableOpInterface"> {
+ let description = [{
+ OpenMP operations that can represent a single leaf of a composite OpenMP
+ construct.
+ }];
+
+ let cppNamespace = "::mlir::omp";
+
+ let methods = [
+ InterfaceMethod<
+ /*description=*/[{
+ Check whether the operation is representing a leaf of a composite OpenMP
+ construct.
+ }],
+ /*retTy=*/"bool",
+ /*methodName=*/"isComposite",
+ (ins ), [{}], [{
+ return $_op->hasAttr("omp.composite");
+ }]
+ >,
+ InterfaceMethod<
+ /*description=*/[{
+ Mark the operation as part of an OpenMP composite construct.
+ }],
+ /*retTy=*/"void",
+ /*methodName=*/"setComposite",
+ (ins "bool":$val), [{}], [{
+ if(val)
----------------
skatrak wrote:
```suggestion
if (val)
```
https://github.com/llvm/llvm-project/pull/102340
More information about the Mlir-commits
mailing list