@@ -170,6 +170,7 @@ class OpenACCClauseCIREmitter final
170170 break ;
171171 }
172172 } else {
173+ // Combined Constructs left.
173174 return clauseNotImplemented (clause);
174175 }
175176 }
@@ -208,6 +209,7 @@ class OpenACCClauseCIREmitter final
208209 // they just modify the other clauses IR. So setting of `lastDeviceType`
209210 // (done above) is all we need.
210211 } else {
212+ // update, data, loop, routine, combined remain.
211213 return clauseNotImplemented (clause);
212214 }
213215 }
@@ -221,6 +223,7 @@ class OpenACCClauseCIREmitter final
221223 } else if constexpr (isOneOfTypes<OpTy, SerialOp>) {
222224 llvm_unreachable (" num_workers not valid on serial" );
223225 } else {
226+ // Combined Remain.
224227 return clauseNotImplemented (clause);
225228 }
226229 }
@@ -234,6 +237,7 @@ class OpenACCClauseCIREmitter final
234237 } else if constexpr (isOneOfTypes<OpTy, SerialOp>) {
235238 llvm_unreachable (" vector_length not valid on serial" );
236239 } else {
240+ // Combined remain.
237241 return clauseNotImplemented (clause);
238242 }
239243 }
@@ -250,6 +254,7 @@ class OpenACCClauseCIREmitter final
250254 createIntExpr (clause.getIntExpr ()), &range));
251255 }
252256 } else {
257+ // Data, enter data, exit data, update, wait, combined remain.
253258 return clauseNotImplemented (clause);
254259 }
255260 }
@@ -266,19 +271,21 @@ class OpenACCClauseCIREmitter final
266271 llvm_unreachable (" var-list version of self shouldn't get here" );
267272 }
268273 } else {
274+ // update and combined remain.
269275 return clauseNotImplemented (clause);
270276 }
271277 }
272278
273279 void VisitIfClause (const OpenACCIfClause &clause) {
274280 if constexpr (isOneOfTypes<OpTy, ParallelOp, SerialOp, KernelsOp, InitOp,
275- ShutdownOp>) {
281+ ShutdownOp, SetOp >) {
276282 operation.getIfCondMutable ().append (
277283 createCondition (clause.getConditionExpr ()));
278284 } else {
279285 // 'if' applies to most of the constructs, but hold off on lowering them
280286 // until we can write tests/know what we're doing with codegen to make
281287 // sure we get it right.
288+ // Enter data, exit data, host_data, update, wait, combined remain.
282289 return clauseNotImplemented (clause);
283290 }
284291 }
@@ -287,8 +294,23 @@ class OpenACCClauseCIREmitter final
287294 if constexpr (isOneOfTypes<OpTy, InitOp, ShutdownOp>) {
288295 operation.getDeviceNumOperandMutable ().append (
289296 createIntExpr (clause.getIntExpr ()));
297+ } else if constexpr (isOneOfTypes<OpTy, SetOp>) {
298+ // This is only a separate case because the getter name is different in
299+ // 'set' for some reason.
300+ operation.getDeviceNumMutable ().append (
301+ createIntExpr (clause.getIntExpr ()));
290302 } else {
291- return clauseNotImplemented (clause);
303+ llvm_unreachable (
304+ " init, shutdown, set, are only valid device_num constructs" );
305+ }
306+ }
307+
308+ void VisitDefaultAsyncClause (const OpenACCDefaultAsyncClause &clause) {
309+ if constexpr (isOneOfTypes<OpTy, SetOp>) {
310+ operation.getDefaultAsyncMutable ().append (
311+ createIntExpr (clause.getIntExpr ()));
312+ } else {
313+ llvm_unreachable (" set, is only valid device_num constructs" );
292314 }
293315 }
294316};
0 commit comments