Commit Graph

143 Commits

Author SHA1 Message Date
Michael Kuperstein
3a6d437582 [PM] Port SpeculativeExecution to the new PM
Differential Revision: https://reviews.llvm.org/D23033


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277393 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-01 21:48:33 +00:00
Michael Kuperstein
093715aad1 [PM] Port LowerGuardIntrinsic to the new PM.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277057 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-28 22:08:41 +00:00
Michael Kuperstein
b3391842c6 [PM] Port SymbolRewriter to the new PM
Differential Revision: https://reviews.llvm.org/D22703


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276687 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-25 20:52:00 +00:00
Jordan Rose
569213a17c StringSwitch cannot be copied (take 2).
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276671 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-25 18:34:51 +00:00
Jordan Rose
c0eeb4bf36 Revert "StringSwitch cannot be copied or moved."
This reverts commit r276652. The clang-query tool is currently
relying on this behavior. I'll try again later.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276661 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-25 17:28:33 +00:00
Jordan Rose
04a86972ba StringSwitch cannot be copied or moved.
...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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276652 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-25 17:08:24 +00:00
Wei Mi
a6c7a032fe [PM] Port BreakCriticalEdges to the new PM.
Differential Revision: https://reviews.llvm.org/D22688


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276449 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-22 18:04:25 +00:00
Wei Mi
3a4fa31d34 [PM] Port NaryReassociate to the new PM
Differential Revision: https://reviews.llvm.org/D22648


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276349 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-21 22:28:52 +00:00
Sean Silva
d8c90ea6b8 [PM] Port LoopUnroll.
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276063 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-19 23:54:23 +00:00
Dehao Chen
e7eb2d5c54 [PM] Convert Loop Strength Reduce pass to new PM
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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275919 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-18 21:41:50 +00:00
Teresa Johnson
385d70633e [PM] Port FunctionImport Pass to new PM
Summary: Port FunctionImport Pass to new PM.

Reviewers: mehdi_amini, davide

Subscribers: davidxl, llvm-commits

Differential Revision: https://reviews.llvm.org/D22475

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275916 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-18 21:22:24 +00:00
Adam Nemet
9b7ecbef6d [LoopDist] Port to new PM
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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275811 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-18 16:29:27 +00:00
Adam Nemet
c7b8b5e22d [OptRemarkEmitter] Port to new PM
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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275810 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-18 16:29:21 +00:00
Adam Nemet
c476e1701d Sort include headers
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275809 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-18 16:29:17 +00:00
Dehao Chen
78ee4b6ec0 [PM] Convert IVUsers analysis to new pass manager.
Summary: Convert IVUsers analysis to new pass manager.

Reviewers: davidxl, silvas

Subscribers: junbuml, sanjoy, llvm-commits, mzolotukhin

Differential Revision: https://reviews.llvm.org/D22434

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275698 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-16 22:51:33 +00:00
Dehao Chen
ca28eb1502 [PM] Convert LoopInstSimplify Pass to new PM
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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275576 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-15 16:42:11 +00:00
Sebastian Pop
9c2e9dc782 code hoisting pass based on GVN
This pass hoists duplicated computations in the program. The primary goal of
gvn-hoist is to reduce the size of functions before inline heuristics to reduce
the total cost of function inlining.

Pass written by Sebastian Pop, Aditya Kumar, Xiaoyu Hu, and Brian Rzycki.
Important algorithmic contributions by Daniel Berlin under the form of reviews.

Differential Revision: http://reviews.llvm.org/D19338

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275561 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-15 13:45:20 +00:00
Jun Bum Lim
fa907d312a [PM] Port Dead Loop Deletion Pass to the new PM
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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275453 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-14 18:28:29 +00:00
Nico Weber
037f8a7c73 Revert r275401, it caused PR28551.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275420 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-14 14:41:25 +00:00
Sebastian Pop
16129fc15d code hoisting pass based on GVN
This pass hoists duplicated computations in the program. The primary goal of
gvn-hoist is to reduce the size of functions before inline heuristics to reduce
the total cost of function inlining.

Pass written by Sebastian Pop, Aditya Kumar, Xiaoyu Hu, and Brian Rzycki.
Important algorithmic contributions by Daniel Berlin under the form of reviews.

Differential Revision: http://reviews.llvm.org/D19338

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275401 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-14 12:18:53 +00:00
Dehao Chen
e06fe02dcc Add missing files for r275222
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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275224 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-12 22:42:24 +00:00
Dehao Chen
2ba4d7a7ea [PM] Port LoopIdiomRecognize Pass to new PM
Summary: Port LoopIdiomRecognize Pass to new PM

Reviewers: davidxl

Subscribers: davide, sanjoy, mzolotukhin, llvm-commits

Differential Revision: http://reviews.llvm.org/D22250

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275202 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-12 18:45:51 +00:00
Vitaly Buka
c0c43ac164 Revert "New pass manager for LICM."
Summary: This reverts commit r275118.

Subscribers: sanjoy, mehdi_amini

Differential Revision: http://reviews.llvm.org/D22259

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275156 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-12 06:25:32 +00:00
Dehao Chen
f84fc6de4f New pass manager for LICM.
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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275118 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-11 22:45:24 +00:00
Davide Italiano
eb0664013d [PM/IPO] Port LowerTypeTests to the new PassManager.
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275082 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-11 18:10:06 +00:00
Sean Silva
89419a6ccc [PM] Port LoopVectorize to the new PM.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275000 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-09 22:56:50 +00:00
Davide Italiano
0dd611bd69 [PM] Port CrossDSOCFI to the new pass manager.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274962 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-09 03:25:35 +00:00
Sean Silva
eb2d4257f4 [PM] Fix a think-o. mv {Scalar,Vectorize}/SLPVectorize.h
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274960 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-09 03:11:29 +00:00
Davide Italiano
fff81b23a8 [PM] Port LoopSimplify to the new pass manager.
While here move simplifyLoop() function to the new header, as
suggested by Chandler in the review.

Differential Revision:  http://reviews.llvm.org/D21404

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274959 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-09 03:03:01 +00:00
Xinliang David Li
fd5a3b4bf8 [PM] name the new PM LAA class LoopAccessAnalysis (LAA) /NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274934 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-08 21:21:44 +00:00
Wei Mi
302c35d621 [PM] Port UnreachableBlockElim to the new Pass Manager
Differential Revision: http://reviews.llvm.org/D22124


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274824 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-08 03:32:49 +00:00
Davide Italiano
d0de2d93f5 [PM] Port InstSimplify to the new pass manager.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274796 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-07 21:14:36 +00:00
Sean Silva
f79d978b96 [PM] Port TailCallElim
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274708 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-06 23:48:41 +00:00
Sean Silva
9afbd6ffb9 [PM] Port CorrelatedValuePropagation
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274705 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-06 23:26:29 +00:00
George Burgess IV
3b5b98a488 [CFLAA] Split into Anders+Steens analysis.
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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274589 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-06 00:26:41 +00:00
Xinliang David Li
10b22c8894 [PM] Port LoopAccessInfo analysis to new PM
It is implemented as a LoopAnalysis pass as 
discussed and agreed upon.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274452 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-02 21:18:40 +00:00
Michael Kuperstein
3fae04db50 [PM] Port ConstantHoisting to the new Pass Manager
Differential Revision: http://reviews.llvm.org/D21945


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274411 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-02 00:16:47 +00:00
Duncan P. N. Exon Smith
d88fd1226e Revert "code hoisting pass based on GVN"
This reverts commit r274305, since it breaks self-hosting:
  http://lab.llvm.org:8080/green/job/clang-stage1-configure-RA_build/22349/
  http://lab.llvm.org:8011/builders/clang-x86_64-linux-selfhost-modules/builds/17232

Note that the blamelist on lab.llvm.org:8011 is incorrect.  The previous
build was r274299, but somehow r274305 wasn't included in the blamelist:
  http://lab.llvm.org:8011/builders/clang-x86_64-linux-selfhost-modules

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274320 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-01 01:51:40 +00:00
Sebastian Pop
164e0c1535 code hoisting pass based on GVN
This pass hoists duplicated computations in the program. The primary goal of
gvn-hoist is to reduce the size of functions before inline heuristics to reduce
the total cost of function inlining.

Pass written by Sebastian Pop, Aditya Kumar, Xiaoyu Hu, and Brian Rzycki.
Important algorithmic contributions by Daniel Berlin under the form of reviews.

Differential Revision: http://reviews.llvm.org/D19338

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274305 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-01 00:24:31 +00:00
Chandler Carruth
77e165569e [PM] Improve the debugging and logging facilities of the CGSCC bits of
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273961 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-27 23:26:08 +00:00
Easwaran Raman
78b1ab747b [PM] Port PartialInlining to the new PM
Differential revision: http://reviews.llvm.org/D21699



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273894 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-27 16:50:18 +00:00
Michael Kuperstein
840a0dd147 [PM] Port float2int to the new pass manager
Differential Revision: http://reviews.llvm.org/D21704


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273747 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-24 23:32:02 +00:00
Michael Kuperstein
783d353e52 Add missing dependency to LLVMPasses
Passes should depend on CodeGen, as that contains some IR-to-IR passes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273724 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-24 21:05:41 +00:00
Michael Kuperstein
f3f8fc6a20 [PM] Port PreISelIntrinsicLowering to the new PM
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273713 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-24 20:13:42 +00:00
Sean Silva
5e494bc177 Add a super basic LazyCallGraph DOT printer.
Access it through -passes=print-lcg-dot

Let me know any suggestions for changing the rendering; I'm not
particularly attached to what is implemented here.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273082 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-18 09:17:32 +00:00
Davide Italiano
e92bed3b5e [PM] Port MergedLoadStoreMotion to the new pass manager, take two.
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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273032 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-17 19:10:09 +00:00
Chandler Carruth
bd6882c677 [PM] Run clang-format over various parts of the new pass manager code
prior to some very substantial patches to isolate any formatting-only
changes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272991 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-17 07:15:29 +00:00
Chandler Carruth
04d0fe9c10 [PM] Remove support for omitting the AnalysisManager argument to new
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272978 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-17 00:11:01 +00:00
Davide Italiano
705956ea8f [PM] Revert the port of MergeLoadStoreMotion to the new pass manager.
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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272925 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-16 17:40:53 +00:00
Xinliang David Li
438355c7b4 [PM] Port Add discriminator pass to new PM
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272847 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-15 21:51:30 +00:00