diff --git a/flang/lib/Optimizer/CodeGen/CodeGen.cpp b/flang/lib/Optimizer/CodeGen/CodeGen.cpp --- a/flang/lib/Optimizer/CodeGen/CodeGen.cpp +++ b/flang/lib/Optimizer/CodeGen/CodeGen.cpp @@ -1038,7 +1038,7 @@ auto linkage = convertLinkage(global.linkName()); auto isConst = global.constant().hasValue(); auto g = rewriter.create( - loc, tyAttr, isConst, linkage, global.sym_name(), initAttr); + loc, tyAttr, isConst, linkage, global.getSymName(), initAttr); auto &gr = g.getInitializerRegion(); rewriter.inlineRegionBefore(global.region(), gr, gr.end()); if (!gr.empty()) { @@ -1640,14 +1640,14 @@ auto ty = mlir::LLVM::LLVMPointerType::get( this->lowerTy().convertType(global.getType())); return rewriter.create(loc, ty, - global.sym_name()); + global.getSymName()); } if (auto global = module.template lookupSymbol(name)) { // The global may have already been translated to LLVM. auto ty = mlir::LLVM::LLVMPointerType::get(global.getType()); return rewriter.create(loc, ty, - global.sym_name()); + global.getSymName()); } // The global does not exist in the current translation unit, but may be // defined elsewhere (e.g., type defined in a module). @@ -2971,7 +2971,7 @@ if (auto constOp = dyn_cast(defop)) return constOp.value(); if (auto llConstOp = dyn_cast(defop)) - if (auto attr = llConstOp.value().dyn_cast()) + if (auto attr = llConstOp.getValue().dyn_cast()) return attr.getValue().getSExtValue(); fir::emitFatalError(val.getLoc(), "must be a constant"); } diff --git a/flang/lib/Optimizer/Transforms/AffinePromotion.cpp b/flang/lib/Optimizer/Transforms/AffinePromotion.cpp --- a/flang/lib/Optimizer/Transforms/AffinePromotion.cpp +++ b/flang/lib/Optimizer/Transforms/AffinePromotion.cpp @@ -203,18 +203,21 @@ /// block arguments of a loopOp or forOp are used as dimensions MaybeAffineExpr toAffineExpr(mlir::Value value) { if (auto op = value.getDefiningOp()) - return affineBinaryOp(mlir::AffineExprKind::Add, toAffineExpr(op.lhs()), - affineBinaryOp(mlir::AffineExprKind::Mul, - toAffineExpr(op.rhs()), - toAffineExpr(-1))); + return affineBinaryOp( + mlir::AffineExprKind::Add, toAffineExpr(op.getLhs()), + affineBinaryOp(mlir::AffineExprKind::Mul, toAffineExpr(op.getRhs()), + toAffineExpr(-1))); if (auto op = value.getDefiningOp()) - return affineBinaryOp(mlir::AffineExprKind::Add, op.lhs(), op.rhs()); + return affineBinaryOp(mlir::AffineExprKind::Add, op.getLhs(), + op.getRhs()); if (auto op = value.getDefiningOp()) - return affineBinaryOp(mlir::AffineExprKind::Mul, op.lhs(), op.rhs()); + return affineBinaryOp(mlir::AffineExprKind::Mul, op.getLhs(), + op.getRhs()); if (auto op = value.getDefiningOp()) - return affineBinaryOp(mlir::AffineExprKind::Mod, op.lhs(), op.rhs()); + return affineBinaryOp(mlir::AffineExprKind::Mod, op.getLhs(), + op.getRhs()); if (auto op = value.getDefiningOp()) - if (auto intConstant = op.value().dyn_cast()) + if (auto intConstant = op.getValue().dyn_cast()) return toAffineExpr(intConstant.getInt()); if (auto blockArg = value.dyn_cast()) { affineArgs.push_back(value); @@ -227,12 +230,12 @@ } void fromCmpIOp(mlir::arith::CmpIOp cmpOp) { - auto lhsAffine = toAffineExpr(cmpOp.lhs()); - auto rhsAffine = toAffineExpr(cmpOp.rhs()); + auto lhsAffine = toAffineExpr(cmpOp.getLhs()); + auto rhsAffine = toAffineExpr(cmpOp.getRhs()); if (!lhsAffine.hasValue() || !rhsAffine.hasValue()) return; auto constraintPair = constraint( - cmpOp.predicate(), rhsAffine.getValue() - lhsAffine.getValue()); + cmpOp.getPredicate(), rhsAffine.getValue() - lhsAffine.getValue()); if (!constraintPair) return; integerSet = mlir::IntegerSet::get(dimCount, symCount, diff --git a/flang/unittests/Optimizer/Builder/DoLoopHelperTest.cpp b/flang/unittests/Optimizer/Builder/DoLoopHelperTest.cpp --- a/flang/unittests/Optimizer/Builder/DoLoopHelperTest.cpp +++ b/flang/unittests/Optimizer/Builder/DoLoopHelperTest.cpp @@ -46,7 +46,7 @@ checkConstantValue(loop.lowerBound(), 0); EXPECT_TRUE(mlir::isa(loop.upperBound().getDefiningOp())); auto subOp = dyn_cast(loop.upperBound().getDefiningOp()); - EXPECT_EQ(c10, subOp.lhs()); + EXPECT_EQ(c10, subOp.getLhs()); checkConstantValue(subOp.getRhs(), 1); checkConstantValue(loop.getStep(), 1); } diff --git a/flang/unittests/Optimizer/Builder/Runtime/CharacterTest.cpp b/flang/unittests/Optimizer/Builder/Runtime/CharacterTest.cpp --- a/flang/unittests/Optimizer/Builder/Runtime/CharacterTest.cpp +++ b/flang/unittests/Optimizer/Builder/Runtime/CharacterTest.cpp @@ -80,7 +80,7 @@ builder, loc, mlir::arith::CmpIPredicate::eq, lhs, rhs); EXPECT_TRUE(mlir::isa(res.getDefiningOp())); auto cmpOp = mlir::dyn_cast(res.getDefiningOp()); - checkCallOp(cmpOp.lhs().getDefiningOp(), fctName, 4, /*addLocArgs=*/false); + checkCallOp(cmpOp.getLhs().getDefiningOp(), fctName, 4, /*addLocArgs=*/false); auto allocas = res.getParentBlock()->getOps(); EXPECT_TRUE(llvm::empty(allocas)); } diff --git a/flang/unittests/Optimizer/Builder/Runtime/NumericTest.cpp b/flang/unittests/Optimizer/Builder/Runtime/NumericTest.cpp --- a/flang/unittests/Optimizer/Builder/Runtime/NumericTest.cpp +++ b/flang/unittests/Optimizer/Builder/Runtime/NumericTest.cpp @@ -58,7 +58,7 @@ mlir::Value select = callOp.getOperands()[1]; EXPECT_TRUE(mlir::isa(select.getDefiningOp())); auto selectOp = mlir::dyn_cast(select.getDefiningOp()); - mlir::Value cmp = selectOp.condition(); + mlir::Value cmp = selectOp.getCondition(); EXPECT_TRUE(mlir::isa(cmp.getDefiningOp())); auto cmpOp = mlir::dyn_cast(cmp.getDefiningOp()); EXPECT_EQ(s, cmpOp.getLhs()); diff --git a/mlir/include/mlir/Dialect/Arithmetic/IR/ArithmeticBase.td b/mlir/include/mlir/Dialect/Arithmetic/IR/ArithmeticBase.td --- a/mlir/include/mlir/Dialect/Arithmetic/IR/ArithmeticBase.td +++ b/mlir/include/mlir/Dialect/Arithmetic/IR/ArithmeticBase.td @@ -22,7 +22,7 @@ }]; let hasConstantMaterializer = 1; - let emitAccessorPrefix = kEmitAccessorPrefix_Both; + let emitAccessorPrefix = kEmitAccessorPrefix_Prefixed; } // The predicate indicates the type of the comparison to perform: diff --git a/mlir/include/mlir/Dialect/LLVMIR/LLVMOpBase.td b/mlir/include/mlir/Dialect/LLVMIR/LLVMOpBase.td --- a/mlir/include/mlir/Dialect/LLVMIR/LLVMOpBase.td +++ b/mlir/include/mlir/Dialect/LLVMIR/LLVMOpBase.td @@ -48,7 +48,7 @@ static StringRef getTargetTripleAttrName() { return "llvm.target_triple"; } }]; - let emitAccessorPrefix = kEmitAccessorPrefix_Both; + let emitAccessorPrefix = kEmitAccessorPrefix_Prefixed; } //===----------------------------------------------------------------------===// diff --git a/mlir/include/mlir/Dialect/Math/IR/MathBase.td b/mlir/include/mlir/Dialect/Math/IR/MathBase.td --- a/mlir/include/mlir/Dialect/Math/IR/MathBase.td +++ b/mlir/include/mlir/Dialect/Math/IR/MathBase.td @@ -15,6 +15,6 @@ The math dialect is intended to hold mathematical operations on integer and floating type beyond simple arithmetics. }]; - let emitAccessorPrefix = kEmitAccessorPrefix_Both; + let emitAccessorPrefix = kEmitAccessorPrefix_Prefixed; } #endif // MATH_BASE diff --git a/mlir/include/mlir/Dialect/Shape/IR/ShapeBase.td b/mlir/include/mlir/Dialect/Shape/IR/ShapeBase.td --- a/mlir/include/mlir/Dialect/Shape/IR/ShapeBase.td +++ b/mlir/include/mlir/Dialect/Shape/IR/ShapeBase.td @@ -39,7 +39,7 @@ let hasConstantMaterializer = 1; let hasOperationAttrVerify = 1; - let emitAccessorPrefix = kEmitAccessorPrefix_Both; + let emitAccessorPrefix = kEmitAccessorPrefix_Prefixed; } def Shape_ShapeType : DialectType