Commit Graph

2592 Commits

Author SHA1 Message Date
Xin Tong
4491d86dc3 Optimize how gen and kill sets are computed in dead store elimination. Existing tests ensure correctness 2015-12-18 09:50:48 -08:00
Erik Eckstein
ae6fa34645 EscapeAnalysis: some new and changed utility functions to be used by alias analysis and ARC analysis. 2015-12-18 08:02:18 -08:00
Dmitri Gribenko
6a66b3cff8 Merge pull request #561 from practicalswift/typos-again
[Typo] Replace PR#514-525 with one large PR
2015-12-18 03:37:02 -08:00
Erik Eckstein
11c8da8f21 SimplifyCFG: add an additional safety check before we try to convert parameters of ABI compatible functions.
This check should not trigger, at least with the current definition of what a convert_function may do.
But still it's a good idea to make the check to be on the safe side.
2015-12-16 14:18:58 -08:00
practicalswift
8ab8847684 Fix typos. 2015-12-16 22:09:32 +01:00
Nadav Rotem
341888cac5 Fix a typo in the assert message. 2015-12-16 10:42:26 -08:00
Nadav Rotem
698dec087e Fix a bug in the overflow removal pass.
We were comparing constraints to arithmetic operations with mismatching types.
2015-12-16 10:39:06 -08:00
Xin Tong
8a0543b49c Rename EnableLocalStoreDSE to DisableLocalStoreDSE and flip the condition 2015-12-15 14:59:08 -08:00
Xin Tong
0f938ef6bd Speculatively disable local dead store. It breaks a test case. It was enabled because TBAA is believed to have been fixed. 2015-12-15 14:55:20 -08:00
Xin Tong
f7cc000e7a Enable local dead store, i.e. a store to a local variable is dead if its not read before function exit. 2015-12-15 09:34:36 -08:00
Xin Tong
1254eaa69e Add the invalidated analysis in DSE 2015-12-15 08:39:31 -08:00
Michael Gottesman
f3c8c5a774 Create SILBasicBlock::getSuccessorBlocks().
This just runs a transform range on getSuccessor()'s ArrayRef<SILSuccessor> so
one does not need to always call Successor.getBB() when iterating over successor
blocks. Instead the transform range does that call for you.

I also updated some loops to use this new SILBasicBlock method to make sure that
the code is tested out by tests that are already in tree. All these places
should be functionally the same albeit a bit cleaner.
2015-12-15 00:36:56 -06:00
Arnold Schwaighofer
99ff2168a6 Add debug messages to loop unrolling and array value propagation 2015-12-14 12:03:42 -08:00
Arnold Schwaighofer
6662e7432a Reapply Add a pass to propagate constant array values to array subscript calls
This reverts commit 82ff59c0b9.

Original commit message:

This allows us to compile the function:

func valueArray() -> Int{
  var a = [1,2,3]
  var r = a[0] + a[1] + a[2]
  return r
}

Down to just a return of the value 6. And should eventually allow us to remove
the overhead of vararg calls.

rdar://19958821
2015-12-14 12:03:41 -08:00
Mark Lacey
0358592e07 Sort file names in SILOptimizer/Transforms/CMakeLists.txt. 2015-12-14 11:57:39 -08:00
Adrian Prantl
64cbec3805 Add SIL syntax for declaring debug variables.
Debug variable info may be attached to debug_value, debug_value_addr,
alloc_box, and alloc_stack instructions.

In order to write textual SIL -> SIL testcases that exercise the handling
of debug information by SIL passes, we need to make a couple of additions
to the textual SIL language. In memory, the debug information attached to
SIL instructions references information from the AST. If we want to create
debug info from parsing a textual .sil file, these bits need to be made
explicit.

Performance Notes: This is memory neutral for compilations from Swift
source code, because the variable name is still stored in the AST. For
compilations from textual source the variable name is stored in tail-
allocated memory following the SIL instruction that introduces the
variable.

<rdar://problem/22707128>
2015-12-14 10:29:50 -08:00
Roman Levenstein
cbcd008ac4 [sil-devirtualizer] Rename isClassWithUnboundGenericParameters and extend it to work with any nominal types 2015-12-14 10:11:46 -08:00
Erik Eckstein
0880ddd6c7 [ReleaseDevirtualizer] fix non-detriministic crash.
rdar://problem/23868367
2015-12-14 09:57:05 -08:00
practicalswift
c6e8459187 Fix typos. 2015-12-14 11:13:30 +01:00
Dmitri Gribenko
f957a68170 Merge pull request #513 from practicalswift/fix-typos-17
Fix typos (17 of 30)
2015-12-14 01:11:28 -08:00
Dmitri Gribenko
ac79855ebd Merge pull request #507 from practicalswift/fix-typos-11
Fix typos (11 of 30)
2015-12-14 01:05:49 -08:00
Dmitri Gribenko
23366f2001 Merge pull request #506 from practicalswift/fix-typos-10
Fix typos (10 of 30)
2015-12-13 20:17:38 -08:00
Dmitri Gribenko
7001cfa2e0 Merge pull request #503 from practicalswift/fix-typos-7
Fix typos (7 of 30)
2015-12-13 20:11:12 -08:00
Michael Gottesman
d94fa0a515 Merge pull request #501 from practicalswift/fix-typos-5
Fix typos (5 of 30)
2015-12-13 18:55:20 -06:00
Dmitri Gribenko
78a568b4bd Merge pull request #499 from practicalswift/fix-typos-3
Fix typos (3 of 30)
2015-12-13 16:20:07 -08:00
practicalswift
41c5b46791 Fix incorrect typo fix. 2015-12-14 00:50:41 +01:00
practicalswift
2c98764fdb Fix typo: invertion → inversion 2015-12-14 00:12:00 +01:00
practicalswift
a297b26278 Fix typo: invaliate → invalidate 2015-12-14 00:12:00 +01:00
practicalswift
163cb4a062 Fix typo: intefering → interfering 2015-12-14 00:11:58 +01:00
practicalswift
b4f2e5dfdf Fix typo: eliminater → eliminator 2015-12-14 00:11:40 +01:00
practicalswift
882d0b3e28 Fix typo: elimimate → eliminate 2015-12-14 00:11:39 +01:00
practicalswift
4d1b0567b6 Fix typo: contant → constant 2015-12-14 00:11:28 +01:00
practicalswift
ba61f44eb5 Fix typo: commutitively → commutatively 2015-12-14 00:11:24 +01:00
practicalswift
45cb275de0 Fix typo: avalable → available 2015-12-14 00:11:18 +01:00
practicalswift
2d9bad6935 Fix typo: anlayzed → analyzed 2015-12-13 23:56:41 +01:00
Xin Tong
3b62b2f15c Rename reduceWithValues to LSValue::reduce 2015-12-13 11:37:34 -08:00
Xin Tong
fb480e9990 Reorder a few header includes 2015-12-13 10:17:15 -08:00
Xin Tong
27b5a40359 Rename MemLocation to LSLocation and LoadStoreValue to LSValue 2015-12-13 10:02:45 -08:00
Xin Tong
642a555a6c Rename MemLocation.h to SILValueProjection.h 2015-12-13 09:31:56 -08:00
Xin Tong
6a5c8701c6 Create a common createExtract function used across DSE and RLE 2015-12-13 09:19:54 -08:00
Xin Tong
7559f2013d Implement a LoadStoreValue vault so that every basic block keeps an
unsigned index instead of the real LoadStoreValue in RLE
2015-12-13 09:10:32 -08:00
Andrew Trick
739b0e9c56 Reorganize SILOptimizer directories for better discoverability.
(libraries now)

It has been generally agreed that we need to do this reorg, and now
seems like the perfect time. Some major pass reorganization is in the
works.

This does not have to be the final word on the matter. The consensus
among those working on the code is that it's much better than what we
had and a better starting point for future bike shedding.

Note that the previous organization was designed to allow separate
analysis and optimization libraries. It turns out this is an
artificial distinction and not an important goal.
2015-12-11 15:14:23 -08:00