@@ -61,9 +61,6 @@ class OpenACCClauseCIREmitter final
6161 // This is necessary since a few of the clauses emit differently based on the
6262 // directive kind they are attached to.
6363 OpenACCDirectiveKind dirKind;
64- // TODO(cir): This source location should be able to go away once the NYI
65- // diagnostics are gone.
66- SourceLocation dirLoc;
6764
6865 llvm::SmallVector<mlir::acc::DeviceType> lastDeviceTypeValues;
6966 // Keep track of the async-clause so that we can shortcut updating the data
@@ -72,10 +69,6 @@ class OpenACCClauseCIREmitter final
7269 // Keep track of the data operands so that we can update their async clauses.
7370 llvm::SmallVector<mlir::Operation *> dataOperands;
7471
75- void clauseNotImplemented (const OpenACCClause &c) {
76- cgf.cgm .errorNYI (c.getSourceRange (), " OpenACC Clause" , c.getClauseKind ());
77- }
78-
7972 void setLastDeviceTypeClause (const OpenACCDeviceTypeClause &clause) {
8073 lastDeviceTypeValues.clear ();
8174
@@ -150,7 +143,7 @@ class OpenACCClauseCIREmitter final
150143 mlir::OpBuilder::InsertionGuard guardCase (builder);
151144 builder.setInsertionPoint (operation.loopOp );
152145 OpenACCClauseCIREmitter<mlir::acc::LoopOp> loopEmitter{
153- operation.loopOp , recipeInsertLocation, cgf, builder, dirKind, dirLoc };
146+ operation.loopOp , recipeInsertLocation, cgf, builder, dirKind};
154147 loopEmitter.lastDeviceTypeValues = lastDeviceTypeValues;
155148 loopEmitter.Visit (&c);
156149 }
@@ -161,12 +154,7 @@ class OpenACCClauseCIREmitter final
161154 mlir::OpBuilder::InsertionGuard guardCase (builder);
162155 builder.setInsertionPoint (operation.computeOp );
163156 OpenACCClauseCIREmitter<typename OpTy::ComputeOpTy> computeEmitter{
164- operation.computeOp ,
165- recipeInsertLocation,
166- cgf,
167- builder,
168- dirKind,
169- dirLoc};
157+ operation.computeOp , recipeInsertLocation, cgf, builder, dirKind};
170158
171159 computeEmitter.lastDeviceTypeValues = lastDeviceTypeValues;
172160
@@ -342,12 +330,12 @@ class OpenACCClauseCIREmitter final
342330 mlir::OpBuilder::InsertPoint &recipeInsertLocation,
343331 CIRGen::CIRGenFunction &cgf,
344332 CIRGen::CIRGenBuilderTy &builder,
345- OpenACCDirectiveKind dirKind, SourceLocation dirLoc )
333+ OpenACCDirectiveKind dirKind)
346334 : operation(operation), recipeInsertLocation(recipeInsertLocation),
347- cgf (cgf), builder(builder), dirKind(dirKind), dirLoc(dirLoc) {}
335+ cgf (cgf), builder(builder), dirKind(dirKind) {}
348336
349337 void VisitClause (const OpenACCClause &clause) {
350- clauseNotImplemented ( clause);
338+ llvm_unreachable ( " Unknown/unhandled clause kind " );
351339 }
352340
353341 // The entry point for the CIR emitter. All users should use this rather than
@@ -406,9 +394,7 @@ class OpenACCClauseCIREmitter final
406394 // Nothing to do here either, combined constructs are just going to use
407395 // 'lastDeviceTypeValues' to set the value for the child visitor.
408396 } else {
409- // TODO: When we've implemented this for everything, switch this to an
410- // unreachable. routine construct remains.
411- return clauseNotImplemented (clause);
397+ llvm_unreachable (" Unknown construct kind in VisitDeviceTypeClause" );
412398 }
413399 }
414400
@@ -472,9 +458,7 @@ class OpenACCClauseCIREmitter final
472458 } else if constexpr (isCombinedType<OpTy>) {
473459 applyToComputeOp (clause);
474460 } else {
475- // TODO: When we've implemented this for everything, switch this to an
476- // unreachable. Combined constructs remain. update construct remains.
477- return clauseNotImplemented (clause);
461+ llvm_unreachable (" Unknown construct kind in VisitAsyncClause" );
478462 }
479463 }
480464
@@ -601,7 +585,7 @@ class OpenACCClauseCIREmitter final
601585 } else {
602586 // TODO: When we've implemented this for everything, switch this to an
603587 // unreachable. update construct remains.
604- return clauseNotImplemented (clause );
588+ llvm_unreachable ( " Unknown construct kind in VisitWaitClause " );
605589 }
606590 }
607591
@@ -620,9 +604,7 @@ class OpenACCClauseCIREmitter final
620604 } else if constexpr (isCombinedType<OpTy>) {
621605 applyToLoopOp (clause);
622606 } else {
623- // TODO: When we've implemented this for everything, switch this to an
624- // unreachable. Routine construct remains.
625- return clauseNotImplemented (clause);
607+ llvm_unreachable (" Unknown construct kind in VisitSeqClause" );
626608 }
627609 }
628610
@@ -632,9 +614,7 @@ class OpenACCClauseCIREmitter final
632614 } else if constexpr (isCombinedType<OpTy>) {
633615 applyToLoopOp (clause);
634616 } else {
635- // TODO: When we've implemented this for everything, switch this to an
636- // unreachable. Routine, construct remains.
637- return clauseNotImplemented (clause);
617+ llvm_unreachable (" Unknown construct kind in VisitAutoClause" );
638618 }
639619 }
640620
@@ -644,9 +624,7 @@ class OpenACCClauseCIREmitter final
644624 } else if constexpr (isCombinedType<OpTy>) {
645625 applyToLoopOp (clause);
646626 } else {
647- // TODO: When we've implemented this for everything, switch this to an
648- // unreachable. Routine construct remains.
649- return clauseNotImplemented (clause);
627+ llvm_unreachable (" Unknown construct kind in VisitIndependentClause" );
650628 }
651629 }
652630
@@ -706,9 +684,7 @@ class OpenACCClauseCIREmitter final
706684 } else if constexpr (isCombinedType<OpTy>) {
707685 applyToLoopOp (clause);
708686 } else {
709- // TODO: When we've implemented this for everything, switch this to an
710- // unreachable. Combined constructs remain.
711- return clauseNotImplemented (clause);
687+ llvm_unreachable (" Unknown construct kind in VisitWorkerClause" );
712688 }
713689 }
714690
@@ -724,9 +700,7 @@ class OpenACCClauseCIREmitter final
724700 } else if constexpr (isCombinedType<OpTy>) {
725701 applyToLoopOp (clause);
726702 } else {
727- // TODO: When we've implemented this for everything, switch this to an
728- // unreachable. Combined constructs remain.
729- return clauseNotImplemented (clause);
703+ llvm_unreachable (" Unknown construct kind in VisitVectorClause" );
730704 }
731705 }
732706
@@ -1128,29 +1102,28 @@ auto makeClauseEmitter(OpTy &op,
11281102 mlir::OpBuilder::InsertPoint &recipeInsertLocation,
11291103 CIRGen::CIRGenFunction &cgf,
11301104 CIRGen::CIRGenBuilderTy &builder,
1131- OpenACCDirectiveKind dirKind, SourceLocation dirLoc ) {
1105+ OpenACCDirectiveKind dirKind) {
11321106 return OpenACCClauseCIREmitter<OpTy>(op, recipeInsertLocation, cgf, builder,
1133- dirKind, dirLoc );
1107+ dirKind);
11341108}
11351109} // namespace
11361110
11371111template <typename Op>
11381112void CIRGenFunction::emitOpenACCClauses (
1139- Op &op, OpenACCDirectiveKind dirKind, SourceLocation dirLoc,
1113+ Op &op, OpenACCDirectiveKind dirKind,
11401114 ArrayRef<const OpenACCClause *> clauses) {
11411115 mlir::OpBuilder::InsertionGuard guardCase (builder);
11421116
11431117 // Sets insertion point before the 'op', since every new expression needs to
11441118 // be before the operation.
11451119 builder.setInsertionPoint (op);
1146- makeClauseEmitter (op, lastRecipeLocation, *this , builder, dirKind, dirLoc )
1120+ makeClauseEmitter (op, lastRecipeLocation, *this , builder, dirKind)
11471121 .emitClauses (clauses);
11481122}
11491123
11501124#define EXPL_SPEC (N ) \
11511125 template void CIRGenFunction::emitOpenACCClauses<N>( \
1152- N &, OpenACCDirectiveKind, SourceLocation, \
1153- ArrayRef<const OpenACCClause *>);
1126+ N &, OpenACCDirectiveKind, ArrayRef<const OpenACCClause *>);
11541127EXPL_SPEC (mlir::acc::ParallelOp)
11551128EXPL_SPEC(mlir::acc::SerialOp)
11561129EXPL_SPEC(mlir::acc::KernelsOp)
@@ -1174,20 +1147,20 @@ EXPL_SPEC(mlir::acc::DeclareEnterOp)
11741147template <typename ComputeOp, typename LoopOp>
11751148void CIRGenFunction::emitOpenACCClauses (
11761149 ComputeOp &op, LoopOp &loopOp, OpenACCDirectiveKind dirKind,
1177- SourceLocation dirLoc, ArrayRef<const OpenACCClause *> clauses) {
1150+ ArrayRef<const OpenACCClause *> clauses) {
11781151 static_assert (std::is_same_v<mlir::acc::LoopOp, LoopOp>);
11791152
11801153 CombinedConstructClauseInfo<ComputeOp> inf{op, loopOp};
11811154 // We cannot set the insertion point here and do so in the emitter, but make
11821155 // sure we reset it with the 'guard' anyway.
11831156 mlir::OpBuilder::InsertionGuard guardCase (builder);
1184- makeClauseEmitter (inf, lastRecipeLocation, *this , builder, dirKind, dirLoc )
1157+ makeClauseEmitter (inf, lastRecipeLocation, *this , builder, dirKind)
11851158 .emitClauses (clauses);
11861159}
11871160
11881161#define EXPL_SPEC (N ) \
11891162 template void CIRGenFunction::emitOpenACCClauses<N, mlir::acc::LoopOp>( \
1190- N &, mlir::acc::LoopOp &, OpenACCDirectiveKind, SourceLocation, \
1163+ N &, mlir::acc::LoopOp &, OpenACCDirectiveKind, \
11911164 ArrayRef<const OpenACCClause *>);
11921165
11931166EXPL_SPEC (mlir::acc::ParallelOp)
0 commit comments