From 46ade282c8d98558d0d1b8e79d2eee3ae00086f1 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Mon, 25 Mar 2019 18:02:49 -0700 Subject: Make FunctionPass::getFunction() return a reference to the function, instead of a pointer. This makes it consistent with all the other methods in FunctionPass, as well as with ModulePass::getModule(). NFC. PiperOrigin-RevId: 240257910 --- mlir/lib/Transforms/MemRefDataFlowOpt.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'mlir/lib/Transforms/MemRefDataFlowOpt.cpp') diff --git a/mlir/lib/Transforms/MemRefDataFlowOpt.cpp b/mlir/lib/Transforms/MemRefDataFlowOpt.cpp index 0356032b46a..e1e253d1869 100644 --- a/mlir/lib/Transforms/MemRefDataFlowOpt.cpp +++ b/mlir/lib/Transforms/MemRefDataFlowOpt.cpp @@ -211,8 +211,8 @@ void MemRefDataFlowOpt::forwardStoreToLoad(LoadOp loadOp) { void MemRefDataFlowOpt::runOnFunction() { // Only supports single block functions at the moment. - Function *f = getFunction(); - if (f->getBlocks().size() != 1) { + Function &f = getFunction(); + if (f.getBlocks().size() != 1) { markAllAnalysesPreserved(); return; } @@ -224,7 +224,7 @@ void MemRefDataFlowOpt::runOnFunction() { memrefsToErase.clear(); // Walk all load's and perform load/store forwarding. - f->walk([&](LoadOp loadOp) { forwardStoreToLoad(loadOp); }); + f.walk([&](LoadOp loadOp) { forwardStoreToLoad(loadOp); }); // Erase all load op's whose results were replaced with store fwd'ed ones. for (auto *loadOp : loadOpsToErase) { -- cgit v1.2.3