[Mlir-commits] [mlir] [MLIR][OpenMP] Add the host_eval clause (PR #116048)
Sergio Afonso
llvmlistbot at llvm.org
Wed Jan 8 06:17:05 PST 2025
================
@@ -444,6 +444,44 @@ class OpenMP_HintClauseSkip<
def OpenMP_HintClause : OpenMP_HintClauseSkip<>;
+//===----------------------------------------------------------------------===//
+// Not in the spec: Clause-like structure to hold host-evaluated values.
+//===----------------------------------------------------------------------===//
+
+class OpenMP_HostEvalClauseSkip<
+ bit traits = false, bit arguments = false, bit assemblyFormat = false,
+ bit description = false, bit extraClassDeclaration = false
+ > : OpenMP_Clause<traits, arguments, assemblyFormat, description,
+ extraClassDeclaration> {
+ let traits = [
+ BlockArgOpenMPOpInterface
+ ];
+
+ let arguments = (ins
+ Variadic<AnyType>:$host_eval_vars
+ );
+
+ let extraClassDeclaration = [{
+ unsigned numHostEvalBlockArgs() {
+ return getHostEvalVars().size();
+ }
+ }];
+
+ let description = [{
+ The optional `host_eval_vars` holds values defined outside of the region of
+ the `IsolatedFromAbove` operation for which a corresponding entry block
----------------
skatrak wrote:
I added the trait to the clause, which will have the effect that any operation including this clause will also be `IsolatedFromAbove`, unless it includes it with `OpenMP_HostEvalClauseSkip<traits = true>`.
https://github.com/llvm/llvm-project/pull/116048
More information about the Mlir-commits
mailing list