================
@@ -30,49 +33,107 @@ CIRGenFunction::emitOMPErrorDirective(const
OMPErrorDirective &s) {
getCIRGenModule().errorNYI(s.getSourceRange(), "OpenMP OMPErrorDirective");
return mlir::failure();
}
-mlir::LogicalResult
-CIRGenFunction::emitOMPParallelDirective(const OMPParallelDirective &s) {
- mlir::LogicalResult res = mlir::success();
- mlir::Location begin = getLoc(s.getBeginLoc());
- mlir::Location end = getLoc(s.getEndLoc());
- mlir::omp::ParallelOperands clauseOps;
- OpenMPClauseEmitter ce(*this, getCIRGenModule(), builder, begin,
s.clauses());
+static llvm::SmallVector<const OMPClause *>
+getLeafClauses(CIRGenFunction &cgf, const OMPExecutableDirective &s,
+ llvm::omp::Directive leaf) {
+ unsigned version = cgf.getContext().getLangOpts().OpenMP;
+ llvm::SmallVector<omp::LeafWithClauses> leaves = omp::decompose(version, s);
+
+ llvm::SmallVector<const OMPClause *> result;
+ for (const omp::LeafWithClauses &l : leaves) {
+ if (l.id != leaf)
+ continue;
+ for (llvm::omp::Clause synth : l.synthesized)
+ cgf.getCIRGenModule().errorNYI(s.getSourceRange(),
+ (llvm::Twine("OpenMP synthesized '") +
+ llvm::omp::getOpenMPClauseName(synth) +
+ "' clause from construct decomposition")
+ .str());
+ llvm::append_range(result, l.clauses);
+ }
+ return result;
+}
+
+/// True when the op emitted for \p leaf must carry the omp.combined marker.
+static bool leafIsCombined(CIRGenFunction &cgf, const OMPExecutableDirective
&s,
----------------
skatrak wrote:
As it's currently implemented, this should also be called for every `emitXyzOp`
function for an operation that might be combined, not just `omp.target`.
https://github.com/llvm/llvm-project/pull/207019
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits