[Mlir-commits] [mlir] [mlir] [docs] fix toy readme bug (PR #172262)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Thu Dec 18 01:18:45 PST 2025


https://github.com/hellozmz updated https://github.com/llvm/llvm-project/pull/172262

>From 37c4f3153ed915d07125727f578c24cbd973a213 Mon Sep 17 00:00:00 2001
From: hellozmz <407190054 at qq.com>
Date: Mon, 15 Dec 2025 08:47:20 +0000
Subject: [PATCH] fix toy readme bug

---
 mlir/docs/Tutorials/Toy/Ch-6.md | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/mlir/docs/Tutorials/Toy/Ch-6.md b/mlir/docs/Tutorials/Toy/Ch-6.md
index 178c07338ac45..13c28c6cb8dff 100644
--- a/mlir/docs/Tutorials/Toy/Ch-6.md
+++ b/mlir/docs/Tutorials/Toy/Ch-6.md
@@ -34,7 +34,7 @@ static FlatSymbolRefAttr getOrInsertPrintf(PatternRewriter &rewriter,
                                            LLVM::LLVMDialect *llvmDialect) {
   auto *context = module.getContext();
   if (module.lookupSymbol<LLVM::LLVMFuncOp>("printf"))
-    return SymbolRefAttr::get("printf", context);
+    return SymbolRefAttr::get(context, "printf");
 
   // Create a function declaration for printf, the signature is:
   //   * `i32 (i8*, ...)`
@@ -48,7 +48,7 @@ static FlatSymbolRefAttr getOrInsertPrintf(PatternRewriter &rewriter,
   PatternRewriter::InsertionGuard insertGuard(rewriter);
   rewriter.setInsertionPointToStart(module.getBody());
   LLVM::LLVMFuncOp::create(rewriter, module.getLoc(), "printf", llvmFnType);
-  return SymbolRefAttr::get("printf", context);
+  return SymbolRefAttr::get(context, "printf");
 }
 ```
 



More information about the Mlir-commits mailing list