================ @@ -136,6 +154,51 @@ class OpenACCClauseCIREmitter final if (!clause.getArchitectures().empty()) operation.setDeviceType( decodeDeviceType(clause.getArchitectures()[0].getIdentifierInfo())); + } else if constexpr (isOneOfTypes<OpTy, ParallelOp, SerialOp, KernelsOp>) { + // Nothing to do here, these constructs don't have any IR for these, as + // they just modify the other clauses IR. So setting of `lastDeviceType` + // (done above) is all we need. + } else { + return clauseNotImplemented(clause); + } + } + + void VisitNumWorkersClause(const OpenACCNumWorkersClause &clause) { + if constexpr (isOneOfTypes<OpTy, ParallelOp, KernelsOp>) { + // Collect the 'existing' device-type attributes so we can re-create them + // and insert them. + llvm::SmallVector<mlir::Attribute> deviceTypes; + mlir::ArrayAttr existingDeviceTypes = + operation.getNumWorkersDeviceTypeAttr(); + + if (existingDeviceTypes) { + for (const mlir::Attribute &Attr : existingDeviceTypes) ---------------- bcardosolopes wrote:
Should this be by value because value semantics? https://github.com/llvm/llvm-project/pull/136578 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits