- Add variants of getAnalysis() and friends that operate on a specific derived operation types.
- Add OpPassManager::getAnalysis() to always call the base getAnalysis() with OpT.
- With this, an OperationPass can call getAnalysis<> using an analysis type that is generic (works on Operation *) or specific to the OpT for the pass. Anything else will fail to compile.
- Extend AnalysisManager unit test to test this, and add a new PassManager unit test to test this functionality in the context of an OperationPass.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Thanks Rahul.
| mlir/include/mlir/Pass/AnalysisManager.h | ||
|---|---|---|
| 132 | Why is this guarded by a template? | |
| 136–142 | typo: assuming its -> it's | |
| 137 | nit: Use triple tick comments here. | |
| 172 | Why is the argument list variadic? | |
| 253 | This method is unnecessary, please remove it. *Op methods already implicitly convert to Operation*, there is nothing gained here by providing the derived operation type. | |
| 253 | Please fix all of the comments to be triple tick. | |
| 275 | .getOperation() shouldn't be necessary. | |
| 290 | This method is unnecessary, please remove it. | |
| mlir/include/mlir/Pass/Pass.h | ||
| 206 | Same here, this method should be removed. | |
| 221 | Same here, this method should be removed. | |
| mlir/include/mlir/Pass/AnalysisManager.h | ||
|---|---|---|
| 132 | Removed. | |
| mlir/unittests/Pass/PassManagerTest.cpp | ||
|---|---|---|
| 67 | Beyond just being able to compile, I think it would be good to test basic functionality. For instance, the correct op is passed into the constructor etc. | |
Why is this guarded by a template?