Refactor the 'walk' methods for operations.

This change refactors and cleans up the implementation of the operation walk methods. After this refactoring is that the explicit template parameter for the operation type is no longer needed for the explicit op walks. For example:

    op->walk<AffineForOp>([](AffineForOp op) { ... });

is now accomplished via:

    op->walk([](AffineForOp op) { ... });

PiperOrigin-RevId: 266209552
This commit is contained in:
River Riddle
2019-08-29 13:04:22 -07:00
committed by A. Unique TensorFlower
parent a085700311
commit 4bfae66d70
28 changed files with 175 additions and 93 deletions

View File

@@ -226,8 +226,7 @@ void MemRefDataFlowOpt::runOnFunction() {
memrefsToErase.clear();
// Walk all load's and perform load/store forwarding.
f.walk<AffineLoadOp>(
[&](AffineLoadOp loadOp) { forwardStoreToLoad(loadOp); });
f.walk([&](AffineLoadOp loadOp) { forwardStoreToLoad(loadOp); });
// Erase all load op's whose results were replaced with store fwd'ed ones.
for (auto *loadOp : loadOpsToErase) {