summaryrefslogtreecommitdiffstats
path: root/mlir/lib/Pass/Pass.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Move the success/failure functions out of LogicalResult and into the mlir ↵River Riddle2019-03-291-6/+6
| | | | | | namespace. PiperOrigin-RevId: 237712180
* Add basic infrastructure for instrumenting pass execution and analysis ↵River Riddle2019-03-291-8/+48
| | | | | | | | | | | | computation. A virtual class, PassInstrumentation, is provided to allow for different parts of the pass manager infrastructure. The currently available hooks allow for instrumenting: * before/after pass execution * after a pass fails * before/after an analysis is computed After getting this infrastructure in place, we can start providing common developer utilities like pass timing, IR printing after pass execution, etc. PiperOrigin-RevId: 237709692
* Rename Status to LogicalResult to avoid conflictions with the Status in ↵River Riddle2019-03-291-17/+18
| | | | | | xla/tensorflow/etc. PiperOrigin-RevId: 237537341
* Update the PassManager infrastructure to return Status instead of bool.River Riddle2019-03-291-26/+24
| | | | PiperOrigin-RevId: 237261205
* Add support for preserving specific analyses in the analysis manager. Passes ↵River Riddle2019-03-291-3/+14
| | | | | | | | | | | can now preserve specific analyses via 'markAnalysesPreserved'. Example: markAnalysesPreserved<DominanceInfo>(); markAnalysesPreserved<DominanceInfo, PostDominanceInfo>(); PiperOrigin-RevId: 237081454
* Change Pass:getFunction() to return pointer instead of ref - NFCUday Bondhugula2019-03-291-1/+1
| | | | | | | | | - change this for consistency - everything else similar takes/returns a Function pointer - the FuncBuilder ctor, Block/Value/Instruction::getFunction(), etc. - saves a whole bunch of &s everywhere PiperOrigin-RevId: 236928761
* Add a 'verifyPasses' flag to the PassManager that specifies if the IR should ↵River Riddle2019-03-291-13/+35
| | | | | | be verified after each pass. This also adds a "verify-each" flag to mlir-opt to optionally disable running the verifier after each pass. PiperOrigin-RevId: 236703760
* Implement the initial AnalysisManagement infrastructure, with the ↵River Riddle2019-03-291-19/+59
| | | | | | | | | | | | | | | | | | introduction of the FunctionAnalysisManager and ModuleAnalysisManager classes. These classes provide analysis computation, caching, and invalidation for a specific IR unit. The invalidation is currently limited to either all or none, i.e. you cannot yet preserve specific analyses. An analysis can be any class, but it must provide the following: * A constructor for a given IR unit. struct MyAnalysis { // Compute this analysis with the provided module. MyAnalysis(Module *module); }; Analyses can be accessed from a Pass by calling either the 'getAnalysisResult<AnalysisT>' or 'getCachedAnalysisResult<AnalysisT>' methods. A FunctionPass may query for a cached analysis on the parent module with 'getCachedModuleAnalysisResult'. Similary, a ModulePass may query an analysis, it doesn't need to be cached, on a child function with 'getFunctionAnalysisResult'. By default, when running a pass all cached analyses are set to be invalidated. If no transformation was performed, a pass can use the method 'markAllAnalysesPreserved' to preserve all analysis results. As noted above, preserving specific analyses is not yet supported. PiperOrigin-RevId: 236505642
* Remove PassResult and have the runOnFunction/runOnModule functions return ↵River Riddle2019-03-291-21/+31
| | | | | | void instead. To signal a pass failure, passes should now invoke the 'signalPassFailure' method. This provides the equivalent functionality when needed, but isn't an intrusive part of the API like PassResult. PiperOrigin-RevId: 236202029
* Move the PassExecutor and ModuleToFunctionPassAdaptor classes from ↵River Riddle2019-03-291-1/+159
| | | | | | PassManager.h to Pass.cpp. This allows for us to remove a dependency on Pass.h from PassManager.h. PiperOrigin-RevId: 236029339
* Port all of the existing passes over to the new pass manager infrastructure. ↵River Riddle2019-03-291-18/+0
| | | | | | This is largely NFC. PiperOrigin-RevId: 235952357
* Implement the initial pass management functionality.River Riddle2019-03-291-0/+59
| | | | | | | | | | | | | | | | The definitions of derived passes have now changed and passes must adhere to the following: * Inherit from a CRTP base class FunctionPass/ModulePass. - This class provides several necessary utilities for the transformation: . Access to the IR unit being transformed (getFunction/getModule) . Various utilities for pass identification and registration. * Provide a 'PassResult runOn(Function|Module)()' method to transform the IR. - This replaces the runOn* functions from before. This patch also introduces the notion of the PassManager. This allows for simplified construction of pass pipelines and acts as the sole interface for executing passes. This is important as FunctionPass will no longer have a 'runOnModule' method. PiperOrigin-RevId: 235952008
* Add a Function::isExternal utility to simplify checks for external functions.River Riddle2019-03-291-1/+1
| | | | PiperOrigin-RevId: 235746553
* NFC: Refactor the files related to passes.River Riddle2019-03-291-0/+47
* PassRegistry is split into its own source file. * Pass related files are moved to a new library 'Pass'. PiperOrigin-RevId: 234705771
OpenPOWER on IntegriCloud