summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Passes/PassBuilder.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [PM] Port IndVarSimplify to the new pass managerSanjoy Das2016-06-051-0/+1
| | | | | | | | | | | | | | | | | Summary: There are some rough corners, since the new pass manager doesn't have (as far as I can tell) LoopSimplify and LCSSA, so I've updated the tests to run them separately in the old pass manager in the lit tests. We also don't have an equivalent for AU.setPreservesCFG() in the new pass manager, so I've left a FIXME. Reviewers: bogner, chandlerc, davide Subscribers: sanjoy, mcrosier, llvm-commits Differential Revision: http://reviews.llvm.org/D20783 llvm-svn: 271846
* [PM] Port GCOVProfiler pass to the new pass managerXinliang David Li2016-06-051-0/+1
| | | | llvm-svn: 271823
* Reapply r271728 after adding move cobstructor for ProfileSummaryInfoEaswaran Raman2016-06-031-1/+2
| | | | llvm-svn: 271745
* Revert r271728 as it breaks Windows buildEaswaran Raman2016-06-031-2/+1
| | | | llvm-svn: 271738
* Analysis pass to access profile summary infoEaswaran Raman2016-06-031-1/+2
| | | | | | Differential Revision: http://reviews.llvm.org/D20648 llvm-svn: 271728
* [MemorySSA] Port to new pass managerGeoff Berry2016-06-011-0/+1
| | | | | | | | | | | | | | | | | Add support for the new pass manager to MemorySSA pass. Change MemorySSA to be computed eagerly upon construction. Change MemorySSAWalker to be owned by the MemorySSA object that creates it. Reviewers: dberlin, george.burgess.iv Subscribers: mcrosier, llvm-commits Differential Revision: http://reviews.llvm.org/D19664 llvm-svn: 271432
* [PM] Port the Sample FDO to new PM (part-2)Xinliang David Li2016-05-271-0/+1
| | | | llvm-svn: 271072
* [PM] Port PartiallyInlineLibCalls to the new pass manager.Davide Italiano2016-05-251-0/+1
| | | | llvm-svn: 270798
* [PM] Port BDCE to the new pass manager.Davide Italiano2016-05-251-1/+2
| | | | llvm-svn: 270647
* New pass: guard wideningSanjoy Das2016-05-181-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Implement guard widening in LLVM. Description from GuardWidening.cpp: The semantics of the `@llvm.experimental.guard` intrinsic lets LLVM transform it so that it fails more often that it did before the transform. This optimization is called "widening" and can be used hoist and common runtime checks in situations like these: ``` %cmp0 = 7 u< Length call @llvm.experimental.guard(i1 %cmp0) [ "deopt"(...) ] call @unknown_side_effects() %cmp1 = 9 u< Length call @llvm.experimental.guard(i1 %cmp1) [ "deopt"(...) ] ... ``` to ``` %cmp0 = 9 u< Length call @llvm.experimental.guard(i1 %cmp0) [ "deopt"(...) ] call @unknown_side_effects() ... ``` If `%cmp0` is false, `@llvm.experimental.guard` will "deoptimize" back to a generic implementation of the same function, which will have the correct semantics from that point onward. It is always _legal_ to deoptimize (so replacing `%cmp0` with false is "correct"), though it may not always be profitable to do so. NB! This pass is a work in progress. It hasn't been tuned to be "production ready" yet. It is known to have quadriatic running time and will not scale to large numbers of guards Reviewers: reames, atrick, bogner, apilipenko, nlewycky Subscribers: mcrosier, llvm-commits Differential Revision: http://reviews.llvm.org/D20143 llvm-svn: 269997
* [PM] Port per-function SCCP to the new pass manager.Davide Italiano2016-05-181-0/+1
| | | | llvm-svn: 269937
* [PM] Port DSE to the new pass managerJustin Bogner2016-05-171-0/+1
| | | | | | Patch by JakeVanAdrighem. Thanks! llvm-svn: 269847
* Appease msc18 to move PassBuilder::crossRegisterProxies() in front of ↵NAKAMURA Takumi2016-05-161-14/+14
| | | | | | | | PassBuilder::parseModulePassPipeline(). I don't know why it crashed cl.exe but it works. llvm-svn: 269643
* [PM] Add newline at the end of the file, for consistency. NFC.Davide Italiano2016-05-141-1/+1
| | | | llvm-svn: 269583
* [PM] Refactor cross-registration of AM into an helper.Davide Italiano2016-05-141-0/+14
| | | | | | Requested by: Chandler Carruth. llvm-svn: 269582
* [PM] Port LowerAtomic to the new pass manager.Davide Italiano2016-05-131-0/+1
| | | | llvm-svn: 269511
* [PM] Port of the DepndenceAnalysis to the new PM.Chandler Carruth2016-05-121-0/+1
| | | | | | | | | | | | | Ported DA to the new PM by splitting the former DependenceAnalysis Pass into a DependenceInfo result type and DependenceAnalysisWrapperPass type and adding a new PM-style DependenceAnalysis analysis pass returning the DependenceInfo. Patch by Philip Pfaffe, most of the review by Justin. Differential Revision: http://reviews.llvm.org/D18834 llvm-svn: 269370
* [PM] port IR based PGO prof-gen pass to new pass managerXinliang David Li2016-05-061-0/+1
| | | | llvm-svn: 268710
* [PM] port Branch Frequency Analaysis pass to new PMXinliang David Li2016-05-051-0/+2
| | | | llvm-svn: 268687
* [PM] Port Interprocedural SCCP to the new pass manager.Davide Italiano2016-05-051-0/+1
| | | | llvm-svn: 268684
* [PM] Port Branch Probability Analysis pass to the new pass manager.Xinliang David Li2016-05-051-0/+1
| | | | | | Differential Revision: http://reviews.llvm.org/D19839 llvm-svn: 268601
* [PM] Port EliminateAvailableExternally pass to the new pass manager.Davide Italiano2016-05-051-0/+1
| | | | llvm-svn: 268599
* [PM] Port ConstantMerge to the new pass manager.Davide Italiano2016-05-051-1/+2
| | | | llvm-svn: 268582
* PM: Port LoopRotation to the new loop pass managerJustin Bogner2016-05-031-0/+1
| | | | llvm-svn: 268452
* PM: Port LoopSimplifyCFG to the new pass managerJustin Bogner2016-05-031-0/+1
| | | | llvm-svn: 268446
* [IPO/GlobalDCE] Port to the new pass manager.Davide Italiano2016-05-031-0/+1
| | | | | | Differential Revision: http://reviews.llvm.org/D19782 llvm-svn: 268425
* PM: Port Reassociate to the new pass managerJustin Bogner2016-04-261-0/+1
| | | | llvm-svn: 267631
* PM: Port Internalize to the new pass managerJustin Bogner2016-04-261-0/+1
| | | | llvm-svn: 267596
* PM: Port GlobalOpt to the new pass managerJustin Bogner2016-04-261-0/+1
| | | | llvm-svn: 267499
* PM: Port SinkingPass to the new pass managerJustin Bogner2016-04-221-0/+1
| | | | llvm-svn: 267199
* PM: Port DCE to the new pass managerJustin Bogner2016-04-221-0/+1
| | | | | | | Also add a very basic test, since apparently there aren't any tests for DCE whatsoever to add the new pass version to. llvm-svn: 267196
* Port DemandedBits to the new pass manager.Michael Kuperstein2016-04-181-0/+1
| | | | | | Differential Revision: http://reviews.llvm.org/D18679 llvm-svn: 266699
* Port InstrProfiling pass to the new pass managerXinliang David Li2016-04-181-0/+1
| | | | | | Differential Revision: http://reviews.llvm.org/D18126 llvm-svn: 266637
* [PM] Rename the CRTP mixin base classes for the new pass manager toChandler Carruth2016-03-111-8/+8
| | | | | | | | | | | | | | | | | | | | clarify their purpose. Firstly, call them "...Mixin" types so it is clear that there is no type hierarchy being formed here. Secondly, use the term 'Info' to clarify that they aren't adding any interesting *semantics* to the passes or analyses, just exposing APIs used by the management layer to get information about the pass or analysis. Thanks to Manuel for helping pin down the naming confusion here and come up with effective names to address it. In case you already have some out-of-tree stuff, the following should be roughly what you want to update: perl -pi -e 's/\b(Pass|Analysis)Base\b/\1InfoMixin/g' llvm-svn: 263217
* [PM] Implement the final conclusion as to how the analysis IDs shouldChandler Carruth2016-03-111-4/+25
| | | | | | | | | | | | | | | | | | | | work in the face of the limitations of DLLs and templated static variables. This requires passes that use the AnalysisBase mixin provide a static variable themselves. So as to keep their APIs clean, I've made these private and befriended the CRTP base class (which is the common practice). I've added documentation to AnalysisBase for why this is necessary and at what point we can go back to the much simpler system. This is clearly a better pattern than the extern template as it caught *numerous* places where the template magic hadn't been applied and things were "just working" but would eventually have broken mysteriously. llvm-svn: 263216
* [PM/AA] Teach the AAManager how to handle module analyses in addition toChandler Carruth2016-03-111-0/+7
| | | | | | | function analyses, and use it to wire up globals-aa to the new pass manager. llvm-svn: 263211
* [PM] Port GVN to the new pass manager, wire it up, and teach a couple ofChandler Carruth2016-03-111-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | tests to run GVN in both modes. This is mostly the boring refactoring just like SROA and other complex transformation passes. There is some trickiness in that GVN's ValueNumber class requires hand holding to get to compile cleanly. I'm open to suggestions about a better pattern there, but I tried several before settling on this. I was trying to balance my desire to sink as much implementation detail into the source file as possible without introducing overly many layers of abstraction. Much like with SROA, the design of this system is made somewhat more cumbersome by the need to support both pass managers without duplicating the significant state and logic of the pass. The same compromise is struck here. I've also left a FIXME in a doxygen comment as the GVN pass seems to have pretty woeful documentation within it. I'd like to submit this with the FIXME and let those more deeply familiar backfill the information here now that we have a nice place in an interface to put that kind of documentaiton. Differential Revision: http://reviews.llvm.org/D18019 llvm-svn: 263208
* [CG] Add a new pass manager printer pass for the old call graph andChandler Carruth2016-03-101-0/+1
| | | | | | | | | | | | | | | | | actually finish wiring up the old call graph. There were bugs in the old call graph that hadn't been caught because it wasn't being tested. It wasn't being tested because it wasn't in the pipeline system and we didn't have a printing pass to run in tests. This fixes all of that. As for why I'm still keeping the old call graph alive its so that I can port GlobalsAA to the new pass manager with out forking it to work with the lazy call graph. That's clearly the right eventual design, but it seems pragmatic to defer that until its necessary. The old call graph works just fine for GlobalsAA. llvm-svn: 263104
* [PM] Port memdep to the new pass manager.Chandler Carruth2016-03-101-0/+1
| | | | | | | | | | | | | | | | | | | | | | | This is a fairly straightforward port to the new pass manager with one exception. It removes a very questionable use of releaseMemory() in the old pass to invalidate its caches between runs on a function. I don't think this is really guaranteed to be safe. I've just used the more direct port to the new PM to address this by nuking the results object each time the pass runs. While this could cause some minor malloc traffic increase, I don't expect the compile time performance hit to be noticable, and it makes the correctness and other aspects of the pass much easier to reason about. In some cases, it may make things faster by making the sets and maps smaller with better locality. Indeed, the measurements collected by Bruno (thanks!!!) show mostly compile time improvements. There is sadly very limited testing at this point as there are only two tests of memdep, and both rely on GVN. I'll be porting GVN next and that will exercise this heavily though. Differential Revision: http://reviews.llvm.org/D17962 llvm-svn: 263082
* [PM] Wire up optimization levels and default pipeline construction APIsChandler Carruth2016-02-281-2/+68
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | in the PassBuilder. These are really just stubs for now, but they give a nice API surface that Clang or other tools can start learning about and enabling for experimentation. I've also wired up parsing various synthetic module pass names to generate these set pipelines. This allows the pipelines to be combined with other passes and have their order controlled, with clear separation between the *kind* of canned pipeline, and the *level* of optimization to be used within that canned pipeline. The most interesting part of this patch is almost certainly the spec for the different optimization levels. I don't think we can ever have hard and fast rules that would make it easy to determine whether a particular optimization makes sense at a particular level -- it will always be in large part a judgement call. But hopefully this will outline the expected rationale that should be used, and the direction that the pipelines should be taken. Much of this was based on a long llvm-dev discussion I started years ago to try and crystalize the intent behind these pipelines, and now, at long long last I'm returning to the task of actually writing it down somewhere that we can cite and try to be consistent with. Differential Revision: http://reviews.llvm.org/D12826 llvm-svn: 262196
* [PM] Finish removing references to fix MSVC builds. Somehow adding baseChandler Carruth2016-02-261-8/+16
| | | | | | | | | classes changed whether the decltype of these expressions was a reference. I'm somewhat horrified why, and there may need to be a deeper fix on MSVC, but this should at least get the bots a step further. llvm-svn: 262008
* [PM] Speculative patch to try and fix MSVC's compilation.Chandler Carruth2016-02-261-1/+3
| | | | | | No idea why r262004 triggered this, but just trying to fix somehow. llvm-svn: 262006
* [PM] Introduce CRTP mixin base classes to help define passes andChandler Carruth2016-02-261-24/+4
| | | | | | | | | | | | | | | | | analyses in the new pass manager. These just handle really basic stuff: turning a type name into a string statically that is nice to print in logs, and getting a static unique ID for each analysis. Sadly, the format of passes in anonymous namespaces makes using their names in tests really annoying so I've customized the names of the no-op passes to keep tests sane to read. This is the first of a few simplifying refactorings for the new pass manager that should reduce boilerplate and confusion. llvm-svn: 262004
* Introduce RegionInfoAnalysis, which compute Region Tree in the new ↵Hongbin Zheng2016-02-251-0/+1
| | | | | | | | PassManager. NFC Differential Revision: http://reviews.llvm.org/D17571 llvm-svn: 261904
* Introduce DominanceFrontierAnalysis to the new PassManager to compute ↵Hongbin Zheng2016-02-251-0/+1
| | | | | | | | DominanceFrontier. NFC Differential Revision: http://reviews.llvm.org/D17570 llvm-svn: 261903
* Introduce analysis pass to compute PostDominators in the new pass manager. NFCHongbin Zheng2016-02-251-0/+1
| | | | | | Differential Revision: http://reviews.llvm.org/D17537 llvm-svn: 261902
* Revert "Introduce analysis pass to compute PostDominators in the new pass ↵Hongbin Zheng2016-02-251-1/+0
| | | | | | | | manager. NFC" This reverts commit a3e5cc6a51ab5ad88d1760c63284294a4e34c018. llvm-svn: 261891
* Revert "Introduce DominanceFrontierAnalysis to the new PassManager to ↵Hongbin Zheng2016-02-251-1/+0
| | | | | | | | compute DominanceFrontier. NFC" This reverts commit 109c38b2226a87b0be73fa7a0a8c1a81df20aeb2. llvm-svn: 261890
* Revert "Introduce RegionInfoAnalysis, which compute Region Tree in the new ↵Hongbin Zheng2016-02-251-1/+0
| | | | | | | | PassManager. NFC" This reverts commit 8228b4d374edeb4cc0c5fddf6e1ab876918ee126. llvm-svn: 261889
* Introduce RegionInfoAnalysis, which compute Region Tree in the new ↵Hongbin Zheng2016-02-251-0/+1
| | | | | | | | PassManager. NFC Differential Revision: http://reviews.llvm.org/D17571 llvm-svn: 261884
OpenPOWER on IntegriCloud