diff --git a/flang/lib/Lower/OpenACC.cpp b/flang/lib/Lower/OpenACC.cpp --- a/flang/lib/Lower/OpenACC.cpp +++ b/flang/lib/Lower/OpenACC.cpp @@ -820,9 +820,9 @@ firOpBuilder, currentLocation, operands, operandSegments); if (addAsyncAttr) - enterDataOp.asyncAttr(firOpBuilder.getUnitAttr()); + enterDataOp.setAsyncAttr(firOpBuilder.getUnitAttr()); if (addWaitAttr) - enterDataOp.waitAttr(firOpBuilder.getUnitAttr()); + enterDataOp.setWaitAttr(firOpBuilder.getUnitAttr()); } static void @@ -896,11 +896,11 @@ firOpBuilder, currentLocation, operands, operandSegments); if (addAsyncAttr) - exitDataOp.asyncAttr(firOpBuilder.getUnitAttr()); + exitDataOp.setAsyncAttr(firOpBuilder.getUnitAttr()); if (addWaitAttr) - exitDataOp.waitAttr(firOpBuilder.getUnitAttr()); + exitDataOp.setWaitAttr(firOpBuilder.getUnitAttr()); if (addFinalizeAttr) - exitDataOp.finalizeAttr(firOpBuilder.getUnitAttr()); + exitDataOp.setFinalizeAttr(firOpBuilder.getUnitAttr()); } template @@ -1010,11 +1010,11 @@ firOpBuilder, currentLocation, operands, operandSegments); if (addAsyncAttr) - updateOp.asyncAttr(firOpBuilder.getUnitAttr()); + updateOp.setAsyncAttr(firOpBuilder.getUnitAttr()); if (addWaitAttr) - updateOp.waitAttr(firOpBuilder.getUnitAttr()); + updateOp.setWaitAttr(firOpBuilder.getUnitAttr()); if (addIfPresentAttr) - updateOp.ifPresentAttr(firOpBuilder.getUnitAttr()); + updateOp.setIfPresentAttr(firOpBuilder.getUnitAttr()); } static void @@ -1116,7 +1116,7 @@ firOpBuilder, currentLocation, operands, operandSegments); if (addAsyncAttr) - waitOp.asyncAttr(firOpBuilder.getUnitAttr()); + waitOp.setAsyncAttr(firOpBuilder.getUnitAttr()); } void Fortran::lower::genOpenACCConstruct( diff --git a/flang/lib/Lower/OpenMP.cpp b/flang/lib/Lower/OpenMP.cpp --- a/flang/lib/Lower/OpenMP.cpp +++ b/flang/lib/Lower/OpenMP.cpp @@ -112,7 +112,8 @@ // TODO: Add lastprivate support for sections construct, simd construct if (std::is_same_v) { omp::WsLoopOp *wsLoopOp = dyn_cast(&op); - mlir::Operation *lastOper = wsLoopOp->region().back().getTerminator(); + mlir::Operation *lastOper = + wsLoopOp->getRegion().back().getTerminator(); firOpBuilder.setInsertionPoint(lastOper); // Our goal here is to introduce the following control flow @@ -150,7 +151,7 @@ cmpOp = firOpBuilder.create( wsLoopOp->getLoc(), mlir::arith::CmpIPredicate::eq, wsLoopOp->getRegion().front().getArguments()[0], - wsLoopOp->upperBound()[0]); + wsLoopOp->getUpperBound()[0]); } mlir::scf::IfOp ifOp = firOpBuilder.create( wsLoopOp->getLoc(), cmpOp, /*else*/ false); @@ -286,7 +287,7 @@ assert(mlir::isa(op) && "The threadprivate operation not created"); mlir::Value symValue = - mlir::dyn_cast(op).sym_addr(); + mlir::dyn_cast(op).getSymAddr(); return firOpBuilder.create( currentLocation, symValue.getType(), symValue); }; @@ -908,17 +909,18 @@ modBuilder.create(loc, reductionOpName, type); else return decl; - builder.createBlock(&decl.initializerRegion(), decl.initializerRegion().end(), - {type}, {loc}); - builder.setInsertionPointToEnd(&decl.initializerRegion().back()); + builder.createBlock(&decl.getInitializerRegion(), + decl.getInitializerRegion().end(), {type}, {loc}); + builder.setInsertionPointToEnd(&decl.getInitializerRegion().back()); Value init = getReductionInitValue(loc, type, reductionOpName, builder); builder.create(loc, init); - builder.createBlock(&decl.reductionRegion(), decl.reductionRegion().end(), - {type, type}, {loc, loc}); - builder.setInsertionPointToEnd(&decl.reductionRegion().back()); - mlir::Value op1 = decl.reductionRegion().front().getArgument(0); - mlir::Value op2 = decl.reductionRegion().front().getArgument(1); + builder.createBlock(&decl.getReductionRegion(), + decl.getReductionRegion().end(), {type, type}, + {loc, loc}); + builder.setInsertionPointToEnd(&decl.getReductionRegion().back()); + mlir::Value op1 = decl.getReductionRegion().front().getArgument(0); + mlir::Value op2 = decl.getReductionRegion().front().getArgument(1); Value reductionOp; switch (intrinsicOp) { @@ -1156,7 +1158,7 @@ "Reduction of some types is not supported"); } reductionDeclSymbols.push_back(SymbolRefAttr::get( - firOpBuilder.getContext(), decl.sym_name())); + firOpBuilder.getContext(), decl.getSymName())); } } } @@ -1232,10 +1234,10 @@ const auto *expr = Fortran::semantics::GetExpr(orderedClause->v); const std::optional orderedClauseValue = Fortran::evaluate::ToInt64(*expr); - wsLoopOp.ordered_valAttr( + wsLoopOp.setOrderedValAttr( firOpBuilder.getI64IntegerAttr(*orderedClauseValue)); } else { - wsLoopOp.ordered_valAttr(firOpBuilder.getI64IntegerAttr(0)); + wsLoopOp.setOrderedValAttr(firOpBuilder.getI64IntegerAttr(0)); } } else if (const auto &scheduleClause = std::get_if( @@ -1247,34 +1249,34 @@ scheduleType.t); switch (scheduleKind) { case Fortran::parser::OmpScheduleClause::ScheduleType::Static: - wsLoopOp.schedule_valAttr(omp::ClauseScheduleKindAttr::get( + wsLoopOp.setScheduleValAttr(omp::ClauseScheduleKindAttr::get( context, omp::ClauseScheduleKind::Static)); break; case Fortran::parser::OmpScheduleClause::ScheduleType::Dynamic: - wsLoopOp.schedule_valAttr(omp::ClauseScheduleKindAttr::get( + wsLoopOp.setScheduleValAttr(omp::ClauseScheduleKindAttr::get( context, omp::ClauseScheduleKind::Dynamic)); break; case Fortran::parser::OmpScheduleClause::ScheduleType::Guided: - wsLoopOp.schedule_valAttr(omp::ClauseScheduleKindAttr::get( + wsLoopOp.setScheduleValAttr(omp::ClauseScheduleKindAttr::get( context, omp::ClauseScheduleKind::Guided)); break; case Fortran::parser::OmpScheduleClause::ScheduleType::Auto: - wsLoopOp.schedule_valAttr(omp::ClauseScheduleKindAttr::get( + wsLoopOp.setScheduleValAttr(omp::ClauseScheduleKindAttr::get( context, omp::ClauseScheduleKind::Auto)); break; case Fortran::parser::OmpScheduleClause::ScheduleType::Runtime: - wsLoopOp.schedule_valAttr(omp::ClauseScheduleKindAttr::get( + wsLoopOp.setScheduleValAttr(omp::ClauseScheduleKindAttr::get( context, omp::ClauseScheduleKind::Runtime)); break; } mlir::omp::ScheduleModifier scheduleModifier = getScheduleModifier(scheduleClause->v); if (scheduleModifier != mlir::omp::ScheduleModifier::none) - wsLoopOp.schedule_modifierAttr( + wsLoopOp.setScheduleModifierAttr( omp::ScheduleModifierAttr::get(context, scheduleModifier)); if (getSIMDModifier(scheduleClause->v) != mlir::omp::ScheduleModifier::none) - wsLoopOp.simd_modifierAttr(firOpBuilder.getUnitAttr()); + wsLoopOp.setSimdModifierAttr(firOpBuilder.getUnitAttr()); } } // In FORTRAN `nowait` clause occur at the end of `omp do` directive. @@ -1289,7 +1291,7 @@ std::get((*endClauseList).t); for (const Fortran::parser::OmpClause &clause : clauseList.v) if (std::get_if(&clause.u)) - wsLoopOp.nowaitAttr(firOpBuilder.getUnitAttr()); + wsLoopOp.setNowaitAttr(firOpBuilder.getUnitAttr()); } createBodyOfOp(wsLoopOp, converter, currentLocation, eval, @@ -1333,7 +1335,7 @@ currentLocation, name, hint); return firOpBuilder.create( currentLocation, mlir::FlatSymbolRefAttr::get( - firOpBuilder.getContext(), global.sym_name())); + firOpBuilder.getContext(), global.getSymName())); } }(); createBodyOfOp(criticalOp, converter, currentLocation, eval); diff --git a/flang/lib/Optimizer/Transforms/AffineDemotion.cpp b/flang/lib/Optimizer/Transforms/AffineDemotion.cpp --- a/flang/lib/Optimizer/Transforms/AffineDemotion.cpp +++ b/flang/lib/Optimizer/Transforms/AffineDemotion.cpp @@ -135,7 +135,7 @@ matchAndRewrite(memref::AllocOp op, mlir::PatternRewriter &rewriter) const override { rewriter.replaceOpWithNewOp(op, convertMemRef(op.getType()), - op.memref()); + op.getMemref()); return success(); } }; diff --git a/mlir/include/mlir/Dialect/Async/IR/AsyncDialect.td b/mlir/include/mlir/Dialect/Async/IR/AsyncDialect.td --- a/mlir/include/mlir/Dialect/Async/IR/AsyncDialect.td +++ b/mlir/include/mlir/Dialect/Async/IR/AsyncDialect.td @@ -38,9 +38,6 @@ static constexpr StringRef kAllowedToBlockAttrName = "async.allowed_to_block"; }]; - - // TODO: Prefixed form overlaps with generated names, update before flipping. - let emitAccessorPrefix = kEmitAccessorPrefix_Both; } #endif // ASYNC_DIALECT_TD diff --git a/mlir/include/mlir/Dialect/GPU/IR/GPUBase.td b/mlir/include/mlir/Dialect/GPU/IR/GPUBase.td --- a/mlir/include/mlir/Dialect/GPU/IR/GPUBase.td +++ b/mlir/include/mlir/Dialect/GPU/IR/GPUBase.td @@ -56,9 +56,6 @@ let dependentDialects = ["arith::ArithDialect"]; let useDefaultAttributePrinterParser = 1; let useDefaultTypePrinterParser = 1; - - // TODO: Update this to _Prefixed. - let emitAccessorPrefix = kEmitAccessorPrefix_Both; } def GPU_AsyncToken : DialectType< diff --git a/mlir/include/mlir/Dialect/MemRef/IR/MemRefBase.td b/mlir/include/mlir/Dialect/MemRef/IR/MemRefBase.td --- a/mlir/include/mlir/Dialect/MemRef/IR/MemRefBase.td +++ b/mlir/include/mlir/Dialect/MemRef/IR/MemRefBase.td @@ -21,8 +21,6 @@ }]; let dependentDialects = ["arith::ArithDialect"]; let hasConstantMaterializer = 1; - - let emitAccessorPrefix = kEmitAccessorPrefix_Both; } #endif // MEMREF_BASE diff --git a/mlir/include/mlir/Dialect/OpenACC/OpenACCOps.td b/mlir/include/mlir/Dialect/OpenACC/OpenACCOps.td --- a/mlir/include/mlir/Dialect/OpenACC/OpenACCOps.td +++ b/mlir/include/mlir/Dialect/OpenACC/OpenACCOps.td @@ -27,9 +27,6 @@ let useDefaultAttributePrinterParser = 1; let cppNamespace = "::mlir::acc"; - - // TODO: Flip to _Prefixed. - let emitAccessorPrefix = kEmitAccessorPrefix_Both; } // AccCommon requires definition of OpenACC_Dialect. diff --git a/mlir/include/mlir/Dialect/OpenMP/OpenMPOps.td b/mlir/include/mlir/Dialect/OpenMP/OpenMPOps.td --- a/mlir/include/mlir/Dialect/OpenMP/OpenMPOps.td +++ b/mlir/include/mlir/Dialect/OpenMP/OpenMPOps.td @@ -28,9 +28,6 @@ let cppNamespace = "::mlir::omp"; let dependentDialects = ["::mlir::LLVM::LLVMDialect"]; let useDefaultAttributePrinterParser = 1; - - // TODO: Flip to _Prefixed. - let emitAccessorPrefix = kEmitAccessorPrefix_Both; } // OmpCommon requires definition of OpenACC_Dialect. diff --git a/mlir/include/mlir/Dialect/PDL/IR/PDLDialect.td b/mlir/include/mlir/Dialect/PDL/IR/PDLDialect.td --- a/mlir/include/mlir/Dialect/PDL/IR/PDLDialect.td +++ b/mlir/include/mlir/Dialect/PDL/IR/PDLDialect.td @@ -69,9 +69,6 @@ let extraClassDeclaration = [{ void registerTypes(); }]; - - // FIXME: Flip to prefixed. - let emitAccessorPrefix = kEmitAccessorPrefix_Both; } #endif // MLIR_DIALECT_PDL_IR_PDLDIALECT diff --git a/mlir/lib/Dialect/MemRef/Transforms/FoldMemRefAliasOps.cpp b/mlir/lib/Dialect/MemRef/Transforms/FoldMemRefAliasOps.cpp --- a/mlir/lib/Dialect/MemRef/Transforms/FoldMemRefAliasOps.cpp +++ b/mlir/lib/Dialect/MemRef/Transforms/FoldMemRefAliasOps.cpp @@ -333,13 +333,13 @@ llvm::TypeSwitch(loadOp) .Case([&](auto op) { - rewriter.replaceOpWithNewOp(loadOp, subViewOp.source(), + rewriter.replaceOpWithNewOp(loadOp, subViewOp.getSource(), sourceIndices); }) .Case([&](vector::TransferReadOp transferReadOp) { rewriter.replaceOpWithNewOp( - transferReadOp, transferReadOp.getVectorType(), subViewOp.source(), - sourceIndices, + transferReadOp, transferReadOp.getVectorType(), + subViewOp.getSource(), sourceIndices, getPermutationMapAttr(rewriter.getContext(), subViewOp, transferReadOp.getPermutationMap()), transferReadOp.getPadding(), @@ -440,11 +440,11 @@ llvm::TypeSwitch(storeOp) .Case([&](auto op) { rewriter.replaceOpWithNewOp( - storeOp, storeOp.getValue(), subViewOp.source(), sourceIndices); + storeOp, storeOp.getValue(), subViewOp.getSource(), sourceIndices); }) .Case([&](vector::TransferWriteOp op) { rewriter.replaceOpWithNewOp( - op, op.getValue(), subViewOp.source(), sourceIndices, + op, op.getValue(), subViewOp.getSource(), sourceIndices, getPermutationMapAttr(rewriter.getContext(), subViewOp, op.getPermutationMap()), op.getInBoundsAttr()); diff --git a/mlir/lib/Dialect/MemRef/Transforms/SimplifyExtractStridedMetadata.cpp b/mlir/lib/Dialect/MemRef/Transforms/SimplifyExtractStridedMetadata.cpp --- a/mlir/lib/Dialect/MemRef/Transforms/SimplifyExtractStridedMetadata.cpp +++ b/mlir/lib/Dialect/MemRef/Transforms/SimplifyExtractStridedMetadata.cpp @@ -721,7 +721,7 @@ if (!viewLikeOp) return rewriter.notifyMatchFailure(extractOp, "not a ViewLike source"); rewriter.updateRootInPlace(extractOp, [&]() { - extractOp.sourceMutable().assign(viewLikeOp.getViewSource()); + extractOp.getSourceMutable().assign(viewLikeOp.getViewSource()); }); return success(); }