summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Passes/PassBuilder.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [PM] Fix a mis-named parameter in parseLoopPass -- the pass manager wasChandler Carruth2016-08-031-6/+6
| | | | | | | called "FPM" instead of "LPM" in a hold-over from when the code was modeled on that used to parse function passes. llvm-svn: 277584
* [PM] Add a generic 'repeat N times' pass wrapper to the new passChandler Carruth2016-08-031-1/+58
| | | | | | | | | | | | | | | | | | | | | | | | manager. While this has some utility for debugging and testing on its own, it is primarily intended to demonstrate the technique for adding custom wrappers that can provide more interesting interation behavior in a nice, orthogonal, and composable layer. Being able to write these kinds of very dynamic and customized controls for running passes was one of the motivating use cases of the new pass manager design, and this gives a hint at how they might look. The actual logic is tiny here, and most of this is just wiring in the pipeline parsing so that this can be widely used. I'm adding this now to show the wiring without a lot of business logic. This is a precursor patch for showing how a "iterate up to N times as long as we devirtualize a call" utility can be added as a separable and composable component along side the CGSCC pass management. Differential Revision: https://reviews.llvm.org/D22405 llvm-svn: 277581
* [PM] Remove the NDEBUG condition around isModulePassName.Chandler Carruth2016-08-031-2/+0
| | | | | | | | I forgot to do this initially, and added when I saw this fail in a no-asserts build, but managed to loose the diff from the actual patch that got submitted. Very sorry. llvm-svn: 277562
* [PM] Significantly refactor the pass pipeline parsing to be easier toChandler Carruth2016-08-031-244/+247
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | reason about and less error prone. The core idea is to fully parse the text without trying to identify passes or structure. This is done with a single state machine. There were various bugs in the logic around this previously that were repeated and scattered across the code. Having a single routine makes it much easier to fix and get correct. For example, this routine doesn't suffer from PR28577. Then the actual pass construction is handled using *much* easier to read code and simple loops, with particular pass manager construction sunk to live with other pass construction. This is especially nice as the pass managers *are* in fact passes. Finally, the "implicit" pass manager synthesis is done much more simply by forming "pre-parsed" structures rather than having to duplicate tons of logic. One of the bugs fixed by this was evident in the tests where we accepted a pipeline that wasn't really well formed. Another bug is PR28577 for which I have added a test case. The code is less efficient than the previous code but I'm really hoping that's not a priority. ;] Thanks to Sean for the review! Differential Revision: https://reviews.llvm.org/D22724 llvm-svn: 277561
* [PM] Port SpeculativeExecution to the new PMMichael Kuperstein2016-08-011-0/+1
| | | | | | Differential Revision: https://reviews.llvm.org/D23033 llvm-svn: 277393
* [PM] Port LowerGuardIntrinsic to the new PM.Michael Kuperstein2016-07-281-0/+1
| | | | llvm-svn: 277057
* [PM] Port SymbolRewriter to the new PMMichael Kuperstein2016-07-251-0/+1
| | | | | | Differential Revision: https://reviews.llvm.org/D22703 llvm-svn: 276687
* StringSwitch cannot be copied (take 2).Jordan Rose2016-07-251-7/+7
| | | | | | | | | | | | | | | | | | | | This prevents StringSwitch from being used with 'auto', which is important because the inferred type is StringSwitch rather than the result type. This is a problem because StringSwitch stores addresses of temporary values rather than copying or moving the value into its own storage. This is a compromise that still allows wrapping StringSwitch in other temporary structures, which (unlike StringSwitch) may be non-trivial to set up and therefore want to at least be movable. (For an example, see QueryParser.cpp in clang-tools-extra.) Changing this uncovered the bug in PassBuilder, also in this patch. Clang doesn't seem to have any occurrences of the issue. Re-commit of r276652. llvm-svn: 276671
* Revert "StringSwitch cannot be copied or moved."Jordan Rose2016-07-251-7/+7
| | | | | | | This reverts commit r276652. The clang-query tool is currently relying on this behavior. I'll try again later. llvm-svn: 276661
* StringSwitch cannot be copied or moved.Jordan Rose2016-07-251-7/+7
| | | | | | | | | | | | ...but most importantly, it cannot be used well with 'auto', because the inferred type is StringSwitch rather than the result type. This is a problem because StringSwitch stores addresses of temporary values rather than copying or moving the value into its own storage. Changing this uncovered the bug in PassBuilder, also in this patch. Clang doesn't seem to have any occurrences of the issue. llvm-svn: 276652
* [PM] Port BreakCriticalEdges to the new PM.Wei Mi2016-07-221-0/+1
| | | | | | Differential Revision: https://reviews.llvm.org/D22688 llvm-svn: 276449
* [PM] Port NaryReassociate to the new PMWei Mi2016-07-211-0/+1
| | | | | | Differential Revision: https://reviews.llvm.org/D22648 llvm-svn: 276349
* [PM] Port LoopUnroll.Sean Silva2016-07-191-0/+1
| | | | | | | | | We just set PreserveLCSSA to always true since we don't have an analogous method `mustPreserveAnalysisID(LCSSA)`. Also port LoopInfo verifier pass to test LoopUnrollPass. llvm-svn: 276063
* [PM] Convert Loop Strength Reduce pass to new PMDehao Chen2016-07-181-0/+1
| | | | | | | | | | | | Summary: Convert Loop String Reduce pass to new PM Reviewers: davidxl, silvas Subscribers: junbuml, sanjoy, mzolotukhin, llvm-commits Differential Revision: https://reviews.llvm.org/D22468 llvm-svn: 275919
* [PM] Port FunctionImport Pass to new PMTeresa Johnson2016-07-181-0/+1
| | | | | | | | | | | | Summary: Port FunctionImport Pass to new PM. Reviewers: mehdi_amini, davide Subscribers: davidxl, llvm-commits Differential Revision: https://reviews.llvm.org/D22475 llvm-svn: 275916
* [LoopDist] Port to new PMAdam Nemet2016-07-181-0/+1
| | | | | | | | | | | | | | | | | | | | | | Summary: The direct motivation for the port is to ensure that the OptRemarkEmitter tests work with the new PM. This remains a function pass because we not only create multiple loops but could also version the original loop. In the test I need to invoke opt with -passes='require<aa>,loop-distribute'. LoopDistribute does not directly depend on AA however LAA does. LAA uses getCachedResult so I *think* we need manually pull in 'aa'. Reviewers: davidxl, silvas Subscribers: sanjoy, llvm-commits, mzolotukhin Differential Revision: https://reviews.llvm.org/D22437 llvm-svn: 275811
* [OptRemarkEmitter] Port to new PMAdam Nemet2016-07-181-0/+1
| | | | | | | | | | | | | | | | | | | | Summary: The main goal is to able to start using the new OptRemarkEmitter analysis from the LoopVectorizer. Since the vectorizer was recently converted to the new PM, it makes sense to convert this analysis as well. This pass is currently tested through the LoopDistribution pass, so I am also porting LoopDistribution to get coverage for this analysis with the new PM. Reviewers: davidxl, silvas Subscribers: llvm-commits, mzolotukhin Differential Revision: https://reviews.llvm.org/D22436 llvm-svn: 275810
* Sort include headersAdam Nemet2016-07-181-1/+1
| | | | llvm-svn: 275809
* [PM] Convert IVUsers analysis to new pass manager.Dehao Chen2016-07-161-0/+1
| | | | | | | | | | | | Summary: Convert IVUsers analysis to new pass manager. Reviewers: davidxl, silvas Subscribers: junbuml, sanjoy, llvm-commits, mzolotukhin Differential Revision: https://reviews.llvm.org/D22434 llvm-svn: 275698
* [PM] Convert LoopInstSimplify Pass to new PMDehao Chen2016-07-151-0/+1
| | | | | | | | | | | | Summary: Convert LoopInstSimplify to new PM. Unfortunately there is no exisiting unittest for this pass. Reviewers: davidxl, silvas Subscribers: silvas, llvm-commits, mzolotukhin Differential Revision: https://reviews.llvm.org/D22280 llvm-svn: 275576
* [PM] Port Dead Loop Deletion Pass to the new PMJun Bum Lim2016-07-141-0/+1
| | | | | | | | | | | | Summary: Port Dead Loop Deletion Pass to the new pass manager. Reviewers: silvas, davide Subscribers: llvm-commits, sanjoy, mcrosier Differential Revision: https://reviews.llvm.org/D21483 llvm-svn: 275453
* Add missing files for r275222Dehao Chen2016-07-121-0/+1
| | | | | | | | | | | | | | New pass manager for LICM. Summary: Port LICM to the new pass manager. Reviewers: davidxl, silvas Subscribers: krasin, vitalybuka, silvas, davide, sanjoy, llvm-commits, mehdi_amini Differential Revision: http://reviews.llvm.org/D21772 llvm-svn: 275224
* [PM] Port LoopIdiomRecognize Pass to new PMDehao Chen2016-07-121-0/+1
| | | | | | | | | | | | Summary: Port LoopIdiomRecognize Pass to new PM Reviewers: davidxl Subscribers: davide, sanjoy, mzolotukhin, llvm-commits Differential Revision: http://reviews.llvm.org/D22250 llvm-svn: 275202
* Revert "New pass manager for LICM."Vitaly Buka2016-07-121-1/+0
| | | | | | | | | | Summary: This reverts commit r275118. Subscribers: sanjoy, mehdi_amini Differential Revision: http://reviews.llvm.org/D22259 llvm-svn: 275156
* New pass manager for LICM.Dehao Chen2016-07-111-0/+1
| | | | | | | | | | | | Summary: Port LICM to the new pass manager. Reviewers: davidxl, silvas Subscribers: silvas, davide, sanjoy, llvm-commits, mehdi_amini Differential Revision: http://reviews.llvm.org/D21772 llvm-svn: 275118
* [PM/IPO] Port LowerTypeTests to the new PassManager.Davide Italiano2016-07-111-0/+1
| | | | | | | | There's a little bit of churn in this patch because the initialization mechanism is now shared between the old and the new PM. Other than that, it's just a pretty mechanical translation. llvm-svn: 275082
* [PM] Port LoopVectorize to the new PM.Sean Silva2016-07-091-0/+1
| | | | llvm-svn: 275000
* [PM] Port CrossDSOCFI to the new pass manager.Davide Italiano2016-07-091-0/+1
| | | | llvm-svn: 274962
* [PM] Fix a think-o. mv {Scalar,Vectorize}/SLPVectorize.hSean Silva2016-07-091-1/+1
| | | | llvm-svn: 274960
* [PM] Port LoopSimplify to the new pass manager.Davide Italiano2016-07-091-0/+1
| | | | | | | | | While here move simplifyLoop() function to the new header, as suggested by Chandler in the review. Differential Revision: http://reviews.llvm.org/D21404 llvm-svn: 274959
* [PM] Port UnreachableBlockElim to the new Pass ManagerWei Mi2016-07-081-0/+1
| | | | | | Differential Revision: http://reviews.llvm.org/D22124 llvm-svn: 274824
* [PM] Port InstSimplify to the new pass manager.Davide Italiano2016-07-071-0/+1
| | | | llvm-svn: 274796
* [PM] Port TailCallElimSean Silva2016-07-061-0/+1
| | | | llvm-svn: 274708
* [PM] Port CorrelatedValuePropagationSean Silva2016-07-061-0/+1
| | | | llvm-svn: 274705
* [CFLAA] Split into Anders+Steens analysis.George Burgess IV2016-07-061-2/+4
| | | | | | | | | | | | | | | | | | | | | StratifiedSets (as implemented) is very fast, but its accuracy is also limited. If we take a more aggressive andersens-like approach, we can be way more accurate, but we'll also end up being slower. So, we've decided to split CFLAA into CFLSteensAA and CFLAndersAA. Long-term, we want to end up in a place where CFLSteens is queried first; if it can provide an answer, great (since queries are basically map lookups). Otherwise, we'll fall back to CFLAnders, BasicAA, etc. This patch splits everything out so we can try to do something like that when we get a reasonable CFLAnders implementation. Patch by Jia Chen. Differential Revision: http://reviews.llvm.org/D21910 llvm-svn: 274589
* [PM] Port LoopAccessInfo analysis to new PMXinliang David Li2016-07-021-0/+1
| | | | | | | It is implemented as a LoopAnalysis pass as discussed and agreed upon. llvm-svn: 274452
* [PM] Port ConstantHoisting to the new Pass ManagerMichael Kuperstein2016-07-021-0/+1
| | | | | | Differential Revision: http://reviews.llvm.org/D21945 llvm-svn: 274411
* [PM] Improve the debugging and logging facilities of the CGSCC bits ofChandler Carruth2016-06-271-4/+5
| | | | | | | | | | | | | the new pass manager. This adds operator<< overloads for the various bits of the LazyCallGraph, dump methods for use from the debugger, and debug logging using them to the CGSCC pass manager. Having this was essential for debugging the call graph update patch, and I've extracted what I could from that patch here to minimize the delta. llvm-svn: 273961
* [PM] Port PartialInlining to the new PMEaswaran Raman2016-06-271-0/+1
| | | | | | Differential revision: http://reviews.llvm.org/D21699 llvm-svn: 273894
* [PM] Port float2int to the new pass managerMichael Kuperstein2016-06-241-0/+1
| | | | | | Differential Revision: http://reviews.llvm.org/D21704 llvm-svn: 273747
* [PM] Port PreISelIntrinsicLowering to the new PMMichael Kuperstein2016-06-241-0/+1
| | | | llvm-svn: 273713
* [PM] Port MergedLoadStoreMotion to the new pass manager, take two.Davide Italiano2016-06-171-0/+1
| | | | | | | | | This is indeed a much cleaner approach (thanks to Daniel Berlin for pointing out), and also David/Sean for review. Differential Revision: http://reviews.llvm.org/D21454 llvm-svn: 273032
* [PM] Run clang-format over various parts of the new pass manager codeChandler Carruth2016-06-171-12/+18
| | | | | | | prior to some very substantial patches to isolate any formatting-only changes. llvm-svn: 272991
* [PM] Remove support for omitting the AnalysisManager argument to newChandler Carruth2016-06-171-8/+17
| | | | | | | | | | | | | | | | | | | | pass manager passes' `run` methods. This removes a bunch of SFINAE goop from the pass manager and just requires pass authors to accept `AnalysisManager<IRUnitT> &` as a dead argument. This is a small price to pay for the simplicity of the system as a whole, despite the noise that changing it causes at this stage. This will also helpfull allow us to make the signature of the run methods much more flexible for different kinds af passes to support things like intelligently updating the pass's progression over IR units. While this touches many, many, files, the changes are really boring. Mostly made with the help of my trusty perl one liners. Thanks to Sean and Hal for bouncing ideas for this with me in IRC. llvm-svn: 272978
* [PM] Revert the port of MergeLoadStoreMotion to the new pass manager.Davide Italiano2016-06-161-1/+0
| | | | | | | | Daniel Berlin expressed some real concerns about the port and proposed and alternative approach. I'll revert this for now while working on a new patch, which I hope to put up for review shortly. Sorry for the churn. llvm-svn: 272925
* [PM] Port Add discriminator pass to new PMXinliang David Li2016-06-151-0/+1
| | | | llvm-svn: 272847
* [PM] Port SLPVectorizer to the new PMSean Silva2016-06-151-0/+1
| | | | | | | | | | | This uses the "runImpl" approach to share code with the old PM. Porting to the new PM meant abandoning the anonymous namespace enclosing most of SLPVectorizer.cpp which is a bit of a bummer (but not a big deal compared to having to pull the pass class into a header which the new PM requires since it calls the constructor directly). llvm-svn: 272766
* [PM] Port AlignmentFromAssumptions to the new PM.Sean Silva2016-06-151-0/+1
| | | | | | This uses the "runImpl" pattern to share code between the old and new PM. llvm-svn: 272757
* [PM] Port WholeProgramDevirt to the new pass manager.Davide Italiano2016-06-141-0/+1
| | | | llvm-svn: 272721
* [PM] Port Mem2Reg to the new pass manager.Davide Italiano2016-06-141-0/+2
| | | | llvm-svn: 272630
OpenPOWER on IntegriCloud