diff options
| author | Chris Lattner <clattner@google.com> | 2019-03-25 18:02:49 -0700 |
|---|---|---|
| committer | jpienaar <jpienaar@google.com> | 2019-03-29 17:40:44 -0700 |
| commit | 46ade282c8d98558d0d1b8e79d2eee3ae00086f1 (patch) | |
| tree | 4ad14d05ba9f7458b815b790fef6e239ac82ddc1 /mlir/lib/Transforms/MemRefDataFlowOpt.cpp | |
| parent | 5f3b914a6e26eb1ceefe6772579d110ac692e6b9 (diff) | |
| download | bcm5719-llvm-46ade282c8d98558d0d1b8e79d2eee3ae00086f1.tar.gz bcm5719-llvm-46ade282c8d98558d0d1b8e79d2eee3ae00086f1.zip | |
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
Diffstat (limited to 'mlir/lib/Transforms/MemRefDataFlowOpt.cpp')
| -rw-r--r-- | mlir/lib/Transforms/MemRefDataFlowOpt.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
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 loadOp) { forwardStoreToLoad(loadOp); }); + f.walk<LoadOp>([&](LoadOp loadOp) { forwardStoreToLoad(loadOp); }); // Erase all load op's whose results were replaced with store fwd'ed ones. for (auto *loadOp : loadOpsToErase) { |

