diff options
Diffstat (limited to 'mlir/docs/Tutorials/QuickstartRewrites.md')
-rw-r--r-- | mlir/docs/Tutorials/QuickstartRewrites.md | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/mlir/docs/Tutorials/QuickstartRewrites.md b/mlir/docs/Tutorials/QuickstartRewrites.md index 0c89065..cbb6f03 100644 --- a/mlir/docs/Tutorials/QuickstartRewrites.md +++ b/mlir/docs/Tutorials/QuickstartRewrites.md @@ -130,7 +130,7 @@ def : Pat<(TF_LeakyReluOp:$old_value, $arg, F32Attr:$a), ```c++ static Value createTFLLeakyRelu(PatternRewriter &rewriter, Operation *op, Value operand, Attribute attr) { - return rewriter.create<mlir::TFL::LeakyReluOp>( + return mlir::TFL::LeakyReluOp::create(rewriter, op->getLoc(), operands[0].getType(), /*arg=*/operands[0], /*alpha=*/cast<FloatAttr>(attrs[0])); } @@ -194,10 +194,10 @@ LogicalResult circt::MulOp::canonicalize(MulOp op, PatternRewriter &rewriter) { // mul(x, c) -> shl(x, log2(c)), where c is a power of two. if (inputs.size() == 2 && matchPattern(inputs.back(), m_RConstant(value)) && value.isPowerOf2()) { - auto shift = rewriter.create<rtl::ConstantOp>(op.getLoc(), op.getType(), + auto shift = rtl::ConstantOp::create(rewriter, op.getLoc(), op.getType(), value.exactLogBase2()); auto shlOp = - rewriter.create<comb::ShlOp>(op.getLoc(), inputs[0], shift); + comb::ShlOp::create(rewriter, op.getLoc(), inputs[0], shift); rewriter.replaceOpWithNewOp<MulOp>(op, op.getType(), ArrayRef<Value>(shlOp)); return success(); |