Michael Gottesman
3f192f0c8d
When using simplifyInstruction, RAUW SimplifedInst[0] with the returned SILValue instead of attempting to replace all operands.
...
The specific case of interest I ran into was:
sil-extract(struct(string_literal[2]))
which using the old logic would fail since we would be trying to replace all
sil-extract arguments with string_literal arguments. The different result arity
would then hit an assertion.
Swift SVN r11607
2013-12-23 19:59:03 +00:00
Nadav Rotem
359ddebf0d
Remove an unused public member.
...
Swift SVN r11272
2013-12-13 21:54:44 +00:00
Michael Gottesman
045b9eb6f9
[cse] Add support for metatype.
...
With this commit CSE reduces the size of the standard library in SIL by 3840
lines.
Swift SVN r10913
2013-12-06 05:04:44 +00:00
Michael Gottesman
d569de7530
[cse] Add support for tuple_element_addr.
...
Swift SVN r10907
2013-12-06 03:48:16 +00:00
Michael Gottesman
63da4ac6e9
[cse] Change order of header includes so swift is before llvm to match other passes.
...
Swift SVN r10882
2013-12-05 20:02:22 +00:00
Michael Gottesman
4379283013
Remove inclusion of SILPasses/Passes.h into Subsystems.h and update all relevant files.
...
Swift SVN r10880
2013-12-05 19:58:21 +00:00
Michael Gottesman
20557076f5
[cse] Remove load/store code from CSE.
...
I originally threw this in to see if we could get anything good from it. When I
looked in the stdlib it was not having a large effect so I am removing it.
Swift SVN r10854
2013-12-05 08:24:24 +00:00
Michael Gottesman
b59ea218c0
[cse] Refactor hash switch into the SILInstruction visitor HashVisitor.
...
Swift SVN r10853
2013-12-05 08:24:23 +00:00
Michael Gottesman
dc69898000
[cse] Change main worklist to use a vector instead of a deque.
...
Swift SVN r10852
2013-12-05 08:24:22 +00:00
Michael Gottesman
715b37b17f
[cse] Move subsystems header to be first since it defines the interface to the file.
...
Swift SVN r10850
2013-12-05 08:24:20 +00:00
Chris Lattner
9ffb31eab2
a few pedantic like tweaks, more important stuff sent through email.
...
Swift SVN r10848
2013-12-05 06:46:32 +00:00
Michael Gottesman
b0c883c777
[cse] Add support for tuple_extract.
...
Swift SVN r10847
2013-12-05 06:34:52 +00:00
Michael Gottesman
f3d1c516a0
[cse] Add support for tuple.
...
Swift SVN r10846
2013-12-05 06:11:02 +00:00
Michael Gottesman
a5d76c9abb
[cse] Add support for struct_element_addr.
...
With this commit CSE reduces the standard library by ~1911 lines.
Swift SVN r10845
2013-12-05 05:35:00 +00:00
Michael Gottesman
d6f3c5245e
[cse] Add support for struct_extract.
...
Swift SVN r10844
2013-12-05 05:16:42 +00:00
Michael Gottesman
14e945e222
[cse] Make sure that we distinguish in between structures that have the same structure but different struct decls.
...
Maybe this is too conservative, but I feel that changing the semantics of types
might be too much. If people later feel that this is too conservative, feel free
to loosen it.
Swift SVN r10843
2013-12-05 02:37:05 +00:00
Michael Gottesman
4428b3da41
[cse] Add support for struct literals.
...
*NOTE* We hash the operands by hashing their values as pointers, not by
attempting to hash those values.
Swift SVN r10842
2013-12-05 02:21:41 +00:00
Michael Gottesman
463e52b930
[cse] Add support for string_literal.
...
Swift SVN r10824
2013-12-05 01:31:20 +00:00
Michael Gottesman
ee52ddd8d4
[cse] Add support for float literals.
...
Swift SVN r10817
2013-12-04 23:37:53 +00:00
Michael Gottesman
c99958d013
[cse] Small cleanup.
...
Swift SVN r10802
2013-12-04 22:46:37 +00:00
Michael Gottesman
8ca4269d36
[cse] Add support for global_addr.
...
Swift SVN r10800
2013-12-04 22:43:31 +00:00
Michael Gottesman
78330bef87
[cse] Add support for BuiltinFunctionRefInst.
...
This removes an additional 219 lines from the stdlib.
Swift SVN r10797
2013-12-04 22:09:08 +00:00
Michael Gottesman
5aebcfba3f
[cse] Added support for function_ref.
...
This reduces the size of the stdlib by another 978 lines.
Swift SVN r10796
2013-12-04 21:55:39 +00:00
Michael Gottesman
f2b8c0991d
[cse] Initial implementation of EarlyCSE Port.
...
This patch contains an initial implementation of CSE for SIL ported from LLVM's
earlycse pass. It follows the overall general structure using
ScopedHashTables/DominatorTrees to perform the computation.
Currently it only handles integer literals to ease with the initial review. Once
this gets in I will be spending some time extending the pass to handle other
instructions.
Even with just handling integers this reduces the size of the stdlib in SIL by
~300 lines.
Swift SVN r10794
2013-12-04 21:49:37 +00:00