diff --git a/mlir/examples/toy/Ch6/mlir/LowerToLLVM.cpp b/mlir/examples/toy/Ch6/mlir/LowerToLLVM.cpp --- a/mlir/examples/toy/Ch6/mlir/LowerToLLVM.cpp +++ b/mlir/examples/toy/Ch6/mlir/LowerToLLVM.cpp @@ -73,7 +73,7 @@ loopIvs.push_back(loop.getInductionVar()); // Terminate the loop body. - rewriter.setInsertionPointToStart(loop.getBody()); + rewriter.setInsertionPointToEnd(loop.getBody()); // Insert a newline after each of the inner dimensions of the shape. if (i != e - 1) diff --git a/mlir/examples/toy/Ch7/mlir/LowerToLLVM.cpp b/mlir/examples/toy/Ch7/mlir/LowerToLLVM.cpp --- a/mlir/examples/toy/Ch7/mlir/LowerToLLVM.cpp +++ b/mlir/examples/toy/Ch7/mlir/LowerToLLVM.cpp @@ -73,7 +73,7 @@ loopIvs.push_back(loop.getInductionVar()); // Terminate the loop body. - rewriter.setInsertionPointToStart(loop.getBody()); + rewriter.setInsertionPointToEnd(loop.getBody()); // Insert a newline after each of the inner dimensions of the shape. if (i != e - 1)