diff --git a/lib/mlir/Transforms/ExtractTopFunc.cc b/lib/mlir/Transforms/ExtractTopFunc.cc index e3283a517c8..6a19bfb7b69 100644 --- a/lib/mlir/Transforms/ExtractTopFunc.cc +++ b/lib/mlir/Transforms/ExtractTopFunc.cc @@ -92,9 +92,9 @@ static void annotateConstantArgs(FuncOp f, ModuleOp m, OpBuilder &b) { for (auto arg : enumerate(f.getArguments())) { auto val = caller.getOperand(arg.index()); - if (mlir::ConstantOp constantOp = - dyn_cast(val.getDefiningOp())) { - f.setArgAttr(arg.index(), SCOP_CONSTANT_VALUE, constantOp.getValue()); + if (arith::ConstantOp constantOp = + dyn_cast(val.getDefiningOp())) { + f.setArgAttr(arg.index(), SCOP_CONSTANT_VALUE, constantOp.value()); } } } @@ -155,7 +155,7 @@ struct ReplaceConstantArgumentsPass Attribute attr = funcOp.getArgAttr(arg.index(), SCOP_CONSTANT_VALUE); if (attr) { b.setInsertionPointToStart(&funcOp.getBlocks().front()); - ConstantOp constantOp = b.create(funcOp.getLoc(), attr); + auto constantOp = b.create(funcOp.getLoc(), attr); arg.value().replaceAllUsesWith(constantOp); } }