Commit Graph

44 Commits

Author SHA1 Message Date
Josh Soref
4eae57f63d spelling: optimizer
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
2022-09-15 19:43:37 -04:00
YOCKOW
d10381557b [NFC] Python Lint: Fix E275(missing whitespace after keyword) issues. 2022-08-21 16:07:07 +09:00
Daniel Duan
3dfc40898c [NFC] Remove Python 2 imports from __future__ (#42086)
The `__future__` we relied on is now,  where the 3 specific things are
all included [since Python 3.0](https://docs.python.org/3/library/__future__.html):

* absolute_import
* print_function
* unicode_literals
* division

These import statements are no-ops and are no longer necessary.
2022-04-13 14:01:30 -07:00
tbkka
3181dd1e4c Fix a bunch of python lint errors (#32951)
* Fix a bunch of python lint errors

* adjust indentation
2020-07-17 14:30:21 -07:00
Gwynne Raskind
09b4159cb2 Global replace of "assertEquals" with "assertEqual" in compliance with deprecation of assertEquals name in Python 2.7 2019-01-16 04:06:38 -06:00
Graydon Hoare
71da5ec519 Fix flake8 warning W605 invalid escape sequence. 2018-11-06 11:38:39 -08:00
Erik Eckstein
39bb14b094 change mangling prefix from $S to $s
This is the final ABI mangling prefix

rdar://problem/38471478
2018-09-19 13:55:11 -07:00
Christopher Rogers
dff1d8983d Fix typos/grammar in comments & docs 2018-07-03 14:31:36 +09:00
Michael Gottesman
b77a47ed83 [bug_reducer] Update/fix for mangling/bitrot.
rdar://31044019
2018-06-03 18:50:35 -07:00
Hugh Bellamy
ad4b338062 Fix python lint failures now not excluded as we provide custom exclusions
Looks like flake8 enables other rules when you add something to the
exclusion list. We added W291
2017-03-27 12:31:56 +07:00
Hugh Bellamy
4f23d61da0 Import print_function wherever we use print() in python code 2017-02-20 11:11:27 +07:00
Hugh Bellamy
fa3543d3c5 Fix some pylint errors for double whitespace after class/function 2017-02-17 15:37:19 +07:00
practicalswift
92ccc44b3a [gardening] Fix recently introduced PEP-8 deviations 2017-01-22 22:02:33 +01:00
practicalswift
7aa8f9e3f4 [gardening] PEP-8 cleanups. 2017-01-21 11:01:40 +01:00
Michael Gottesman
85f510fb06 [bug-reducer] Add support for constructing a subprocess fingerprint hash.
This is a sha256 of 0/1 depending on error_code, stdout, stderr.
2017-01-10 22:38:25 -08:00
Michael Gottesman
5d3f47f118 [bug-reducer] Rename bug_reducer_utils.py => swift_tools.py 2017-01-10 22:38:25 -08:00
Michael Gottesman
7c7b405141 [bug-reducer] Remove print of output from test. This was debugging code that was by mistake committed. 2017-01-10 22:38:25 -08:00
Michael Gottesman
4a2912d377 [bug-reducer] If extra_args is None, set self.extra_args to [], not None since list.extend does not accept None as an iterable... Oops. 2017-01-09 16:41:07 -08:00
practicalswift
6d1ae2a39c [gardening] 2016 → 2017 2017-01-06 16:41:22 +01:00
Michael Gottesman
0403feba82 [bug-reducer-tester] Add support for causing a miscompile instead of just asserting.
Previously, bug reducer tester would just assert when it saw a direct apply to
its target function. Now we add support for also causing a miscompile by just
deleting the apply. This is tested by eliminating an apply to putchar to ensure
we are not dependent on any stdlib details.
2017-01-04 15:21:30 -08:00
Michael Gottesman
4ce78fd082 [bug-reducer] When invoking, emit a command line that outputs sib. When printing a commandline for reproduction purposes by the user, drop -emit-sib so sil-opt emits textual sil.
Just a cleanup while I am using this.
2017-01-04 13:18:27 -08:00
Michael Gottesman
9e6089a7d9 [bug-reducer] Fix an issue where we would always print the last optimized file.
That would be incorrect in the case where the bug reducer did not crash on the
last iteration. I ran into this a few weeks ago when using the random bug
finder, but can not seem to reproduce the issue.

I would rather fix it than have someone hit this.
2017-01-04 01:11:47 -08:00
practicalswift
8ee628fb14 Merge pull request #6408 from practicalswift/gardening-20161220
[gardening] Remove "REQUIRES: asserts". Correct Swift URL. Typos. Headers. PEP-8.
2016-12-20 18:47:42 +01:00
practicalswift
1ff3b76b75 [gardening] PEP-8 fixes. 2016-12-20 10:10:29 +01:00
Michael Gottesman
be5ec6f990 [passmanager] Remove ExecutionKind::UntilFixPoint and all of ExecutionKind.
rdar://29650781
2016-12-19 13:38:46 -08:00
practicalswift
31676caa20 [gardening] PEP-8 cleanups. 2016-12-18 09:48:30 +01:00
practicalswift
ddedf240ec [gardening] Use correct Swift URLs. 2016-12-17 22:33:09 +01:00
practicalswift
16d6dce62e [gardening] Fix recently introduced typos. 2016-12-16 21:42:09 +01:00
practicalswift
f60da8ecac [gardening] PEP-8: Stay within 79 chars. 2016-12-16 21:42:08 +01:00
practicalswift
77a07467bf [gardening] Fix invalid Swift URLs in headers. 2016-12-16 21:42:08 +01:00
Michael Gottesman
ef6ffa7975 [sil-bug-reducer] Refactor random-search to use opt_bug_reducer/func_bug_reducer. 2016-12-15 10:09:30 -08:00
Michael Gottesman
15afaa96a8 [sil-bug-reducer] Update docs now that we can reduce SIL. 2016-12-15 01:49:14 -08:00
Michael Gottesman
7209d4da09 [sil-bug-reducer] We squelch stderr most of the time so we lose errors, make sure to at least catch missing input file errors by checking them manually.
The output from the crashers becomes way too large otherwise.
2016-12-15 01:20:04 -08:00
Michael Gottesman
7072a146a1 [sil-bug-reducer] Add --reduce-sil flag to ./bug-reduce opt.
This will cause the tool to first bisect on passes, and then try to reduce the
SIL by deleting functions.
2016-12-15 01:16:26 -08:00
Michael Gottesman
59746ecfa5 [sil-bug-reducer] Add function reducing functionality.
Now once you have a pass list using:

  ./bug-reducer opt ...

You can take the pass list and give it and the output file to bug-reducer func:

  ./bug-reducer func ...

which will reduce the function list for you given a pass list. This is kept
separate to allow for testing and orthogonality. In a future commit, I am going
to add an option to ./bug-reducer opt that will invoke the function reducer
automagically.
2016-12-15 00:40:28 -08:00
Michael Gottesman
895e287fd6 [sil-bug-reducer] Pass in a config object to SILToolInvoker instead of the full args.
This enables us to specify variables like module_name, sdk without having the
SILToolInvoker rely on the argument for the input_file. This is a nice
separation and will let me implement easily a func_bug_reducer tool that can be
enabled after reducing  the number of functions using opt_bug_reducer.py.
2016-12-15 00:39:29 -08:00
Michael Gottesman
b4c145f7f5 [sil-bug-reducer] SILTools.sil_func_extractor should return sil_func_extractor, not sil_opt.
*doh*.
2016-12-15 00:35:30 -08:00
Michael Gottesman
ecd06f371f [sil-bug-reducer] Refactor adding subparsers given that all subparsers have a common swift_build_dir arg. 2016-12-14 22:50:23 -08:00
Michael Gottesman
9e59c9cfe2 [sil-bug-reducer] Remove distinction in between early module passes and other passes.
Originally I put this distinction in to ensure that we matched the pass pipeline
more exactly since the early module passes run until fix point. This upon
further reflection actually should not cause any issues given the bottom up pass
manager. So just treat the early module passes as normal passes, simplifying the
bug reducer.
2016-12-14 21:37:16 -08:00
Michael Gottesman
55c68a16af [sil-bug-reducer] Remove dead function. NFC. 2016-12-14 21:32:53 -08:00
Michael Gottesman
88884e44a4 [sil-bug-reducer] Test suffix pass pipeline in need of prefix pipeline case. 2016-12-13 11:57:01 -08:00
Michael Gottesman
535e293a5b [sil-bug-reducer] Add a full example to the README.md. 2016-12-13 10:20:56 -08:00
Michael Gottesman
45daa56c71 [sil-bug-reducer] Make the output more explicit about the final file, passes, and given a full command line to reproduce. 2016-12-13 10:07:14 -08:00
Michael Gottesman
b7a79756db [sil-bug-reducer] Initial version of bug_reducer.
Currently it supports random bug finding and opt pipeline reduction. At some
point in the future it will support:

1. Reducing of optimizer crasher test cases.
2. Reducing optimizer miscompile test cases.

But those are for another time, this is just a first step. Patches welcome = ).
Check out llvm's bugpoint for inspiration.

It also has a basic test of pass pipeline reduction that is triggered via the
validation testing in lit. One thing to note here is that the tool right now
assumes darwin. This can be fixed in the future.
2016-12-12 23:30:51 -08:00