@@ -170,6 +170,7 @@ class OpenACCClauseCIREmitter final
170
170
break ;
171
171
}
172
172
} else {
173
+ // Combined Constructs left.
173
174
return clauseNotImplemented (clause);
174
175
}
175
176
}
@@ -208,6 +209,7 @@ class OpenACCClauseCIREmitter final
208
209
// they just modify the other clauses IR. So setting of `lastDeviceType`
209
210
// (done above) is all we need.
210
211
} else {
212
+ // update, data, loop, routine, combined remain.
211
213
return clauseNotImplemented (clause);
212
214
}
213
215
}
@@ -221,6 +223,7 @@ class OpenACCClauseCIREmitter final
221
223
} else if constexpr (isOneOfTypes<OpTy, SerialOp>) {
222
224
llvm_unreachable (" num_workers not valid on serial" );
223
225
} else {
226
+ // Combined Remain.
224
227
return clauseNotImplemented (clause);
225
228
}
226
229
}
@@ -234,6 +237,7 @@ class OpenACCClauseCIREmitter final
234
237
} else if constexpr (isOneOfTypes<OpTy, SerialOp>) {
235
238
llvm_unreachable (" vector_length not valid on serial" );
236
239
} else {
240
+ // Combined remain.
237
241
return clauseNotImplemented (clause);
238
242
}
239
243
}
@@ -250,6 +254,7 @@ class OpenACCClauseCIREmitter final
250
254
createIntExpr (clause.getIntExpr ()), &range));
251
255
}
252
256
} else {
257
+ // Data, enter data, exit data, update, wait, combined remain.
253
258
return clauseNotImplemented (clause);
254
259
}
255
260
}
@@ -266,19 +271,21 @@ class OpenACCClauseCIREmitter final
266
271
llvm_unreachable (" var-list version of self shouldn't get here" );
267
272
}
268
273
} else {
274
+ // update and combined remain.
269
275
return clauseNotImplemented (clause);
270
276
}
271
277
}
272
278
273
279
void VisitIfClause (const OpenACCIfClause &clause) {
274
280
if constexpr (isOneOfTypes<OpTy, ParallelOp, SerialOp, KernelsOp, InitOp,
275
- ShutdownOp>) {
281
+ ShutdownOp, SetOp >) {
276
282
operation.getIfCondMutable ().append (
277
283
createCondition (clause.getConditionExpr ()));
278
284
} else {
279
285
// 'if' applies to most of the constructs, but hold off on lowering them
280
286
// until we can write tests/know what we're doing with codegen to make
281
287
// sure we get it right.
288
+ // Enter data, exit data, host_data, update, wait, combined remain.
282
289
return clauseNotImplemented (clause);
283
290
}
284
291
}
@@ -287,8 +294,23 @@ class OpenACCClauseCIREmitter final
287
294
if constexpr (isOneOfTypes<OpTy, InitOp, ShutdownOp>) {
288
295
operation.getDeviceNumOperandMutable ().append (
289
296
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 ()));
290
302
} 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" );
292
314
}
293
315
}
294
316
};
0 commit comments