Commit Graph

22 Commits

Author SHA1 Message Date
Michael Gottesman
5baa90ca4c [irgen-prepare] Move SILCleanup to ./lib/SILOptimizer/Mandatory and rename it to IRGenPrepare.
I am going to be adding logic here to enable apple/swift#1550 to be completed.
The rename makes sense due to precedent from LLVM's codegen prepare and also
since I am going to be expanding what the pass is doing beyond just "cleaning
up". It is really a grab bag pass for performing simple transformations that we
do not want to pollute IRGen's logic with.

https://github.com/apple/swift/pull/15502

rdar://39335800
2018-04-17 00:07:16 -07:00
Hugh Bellamy
fa3543d3c5 Fix some pylint errors for double whitespace after class/function 2017-02-17 15:37:19 +07:00
Andrew Trick
855918c620 [Lowering] Add an AddressLowering pass. 2017-02-13 17:10:02 -08:00
Joe Shajrawi
91bba4d425 Do not emit shadow copied for inout parameters (#5218)
radar rdar://problem/28434323

SILGen has no reason to insert shadow copies for inout parameters any more. They cannot be captured. We still emit these copies. Sometimes deshadowing removes them, but sometimes it does not.

In this PR we just avoid emitting the copies and remove the deshadowing pass.

This PR chery-picked some of @dduan work and built on top of it.
2016-10-13 10:10:59 -07:00
practicalswift
776d28cc3c [Python] Remove unused function diagnostic_passlist() 2016-03-12 20:16:27 +01:00
Brian Gesiak
c9000af795 Merge pull request #1526 from practicalswift/fix-pep8-violations-ii
[Python] Fix five classes of PEP-8 violations (E101/E111/E128/E302/W191)
2016-03-08 23:55:46 -05:00
practicalswift
265835fdfc [Python] Use consistent import ordering for Python code
Ordering used:
1.) standard library imports
2.) third party imports
3.) local package imports

Each group is individually alphabetized.
2016-03-07 23:25:16 +01:00
practicalswift
183da818df [Python] Fix five classes of PEP-8 violations (E101/E111/E128/E302/W191)
* E101: indentation contains mixed spaces and tabs
* E111: indentation is not a multiple of four
* E128: continuation line under-indented for visual indent
* E302: expected 2 blank lines, found 1
* W191: indentation contains tabs
2016-03-07 22:36:23 +01:00
practicalswift
f6d6585ee0 [Python] Improve Python consistency: Use function_name(…) throughout (PEP8) 2016-02-29 22:49:19 +01:00
practicalswift
679f1853d2 PEP8: Fix all violations of type "at least two spaces before inline comment" (E261) 2016-01-24 10:10:55 +01:00
practicalswift
84a31184c7 PEP8: Fix all violations of type "missing whitespace after ','" (E231) 2016-01-24 09:40:32 +01:00
practicalswift
1cd4d4e9c9 [gardening] Fix violations of non-controversial PEP8 rules
Fixes:
* multiple statements on one line (colon) (E701)
* missing whitespace around arithmetic operator (E226)
* missing whitespace around operator (E225)
* closing bracket does not match visual indentation (E124)
* blank line contains whitespace (W293)
* continuation line missing indentation or outdented (E122)
* continuation line over-indented for hanging indent (E126)
* missing expected blank line (E301)
* trailing whitespace (W291)
* unexpected spaces around keyword / parameter equals (E251)
* whitespace after '(', '[' or '{' (E201)
* whitespace before ')', ']' or '}' (E202)
* whitespace before ',' or ':' (E203)
2016-01-23 09:23:33 +01:00
practicalswift
22d043fcc0 [gardening] Fix violations of non-controversial PEP8 rules.
Fixes:
* blank line at end of file
* closing bracket does not match indentation of opening bracket's line
* continuation line over-indented for hanging indent
* continuation line over-indented for visual indent
* continuation line unaligned for hanging indent
* inline comment should start with '# '
* missing whitespace around arithmetic operator
* missing whitespace around bitwise or shift operator
* multiple imports on one line
* multiple spaces after ':'
* multiple spaces after operator
2016-01-16 00:47:43 +01:00
practicalswift
78c5264885 Make scripts/pipeline_generator.py usable again.
Before this commit:

```
$ utils/pass-pipeline/scripts/pipeline_generator.py
utils/pass-pipeline/scripts/pipeline_generator.py
Traceback (most recent call last):
  File "utils/pass-pipeline/scripts/pipeline_generator.py", line 15, in <module>
    normal_pipeline = [x for x in pass_pipeline_library.normal_passpipelines()]
  File "/path/to/swift/utils/pass-pipeline/src/pass_pipeline_library.py", line 106, in normal_passpipelines
    x.addPass(specialization_passlist())
NameError: global name 'specialization_passlist' is not defined
```

After this commit:

```
$ utils/pass-pipeline/scripts/pipeline_generator.py
[
    [
        "HighLevel",
        "run_n_times",
        2,
        "SimplifyCFG",
…
```
2015-12-29 12:52:34 +01:00
practicalswift
4f2496e1a6 Various Python cleanups
Fixes:
* Unused import
* Redundant backslash
* Use of discouraged if not x in y
* Use of deprecated form of raising exceptions

Follow-up to PR #655 as requested by @gribozavr
2015-12-22 21:05:47 +01:00
practicalswift
a477105a70 Sort passes as per @jrose-apple's request in #540 2015-12-16 22:17:37 +01:00
practicalswift
d4cbcfff04 Fix NameError bug: s/Devirtualizer/SpeculativeDevirtualizer/ 2015-12-14 23:22:46 +01:00
Mark Lacey
4c62204007 Remove the stand-alone generic specialization pass.
We do generic specialization in the inliner now, so we no longer need
the separate pass.

The order the specializations are inserted into the module differs as a
result of this, which means that one unfortunately huge test needed
substantial changes.

At some point this test needs to be converted to SIL and split up into
smaller chunks.

Swift SVN r31323
2015-08-19 00:24:00 +00:00
Mark Lacey
99cf3dcf2a Rename Devirtualizer.cpp to SpeculativeDevirtualizer.cpp.
This file now contains only the speculative devirtualization pass, so
rename accordingly.

Also remove remaining references to "inline caches", since we're now
calling it speculative devirtualization.

Swift SVN r31096
2015-08-08 06:42:30 +00:00
Michael Gottesman
e998041451 pipeline: Don't hard code pass names into pipelines.py. Just use the PASSES variable from passes.py in the library.
The pipeline code still has too much hard coded. I am going to write a little
tool that is disabled by default that when run provides all this information
from the compiler. So the tool will dump out the current pass list, the normal optimization
pipelines, and then all of the passes used in such pipelines (i.e. AADumper is a
great pass but it won't change how the stdlib compiles). But for now I am going
to leave it hard coded.

Swift SVN r24313
2015-01-09 17:29:36 +00:00
Michael Gottesman
73a5a1bcf7 [passpipeline] Some small cleanups. NFC.
Swift SVN r24311
2015-01-09 17:29:35 +00:00
Michael Gottesman
4ef6edbda9 Add python utilities for generating pipeline files.
Specifically the following utilities are provided:

1. Normal Pipeline.
2. Normal Pipeline with Specific Passes Disabled.
5. Normal Pipeline with specific PassLists disabled.

Swift SVN r24056
2014-12-20 04:09:48 +00:00