Commit Graph

33 Commits

Author SHA1 Message Date
Xin Tong
84a6ff1d98 And lastly rename NewProjection to Projection. This is a NFC. rdar://24520269 2016-02-09 22:20:10 -08:00
Xin Tong
d5dfe57e14 Migrate to use new projection for COWArrayOpt. This should be a NFC.
This is part of rdar://24520269
2016-02-07 13:56:12 -08:00
saisi
08abcd92c3 fixed niggling typos 2016-01-29 22:22:12 -05:00
Erik Eckstein
905fd37b98 COWArrayOpt: ensure that we can hoist all address projections that we stripped.
This change is needed because we new consider index_addr as address projection in Projection.h
2016-01-27 09:04:57 -08:00
Erik Eckstein
74d44b74e7 SIL: remove SILValue::getDef and add a cast operator to ValueBase * as a repelacement. NFC. 2016-01-25 15:00:49 -08:00
Erik Eckstein
506ab9809f SIL: remove getTyp() from SILValue 2016-01-25 15:00:49 -08:00
Erik Eckstein
5a53b31f57 SIL: remove use-iteration functions from SILValue.
They are not needed anymore. NFC.
2016-01-25 15:00:49 -08:00
Erik Eckstein
b745691a38 SIL refactoring: Move some functions out of SILValue and Operand
SILValue.h/.cpp just defines the SIL base classes. Referring to specific instructions is a (small) kind of layering violation.
Also I want to keep SILValue small so that it is really just a type alias of ValueBase*.
NFC.
2016-01-25 10:37:03 -08:00
practicalswift
638a7c9474 [gardening] Avoid "var == true" and "var == false" 2016-01-23 19:57:07 +01:00
Erik Eckstein
2db6f3d213 SIL: remove multiple result values from SILValue
As there are no instructions left which produce multiple result values, this is a NFC regarding the generated SIL and generated code.
Although this commit is large, most changes are straightforward adoptions to the changes in the ValueBase and SILValue classes.
2016-01-21 10:30:31 -08:00
Erik Eckstein
8110b1ebc8 [SIL] Let alloc_box return a single value.
And use project_box to get to the address value.
SILGen now generates a project_box for each alloc_box.
And IRGen re-uses the address value from the alloc_box if the operand of project_box is an alloc_box.
This lets the generated code be the same as before.

Other than that most changes of this (quite large) commit are straightforward.
2016-01-19 08:59:24 -08:00
Michael Gottesman
88929f8e99 Fix implicit assumption that RetainArray is not nullptr.
The code in question was the following:

  auto *RetainArray = dyn_cast_or_null<StrongRetainInst>(getInstBefore(Call));
  if (!RetainArray && MayHaveBridgedObjectElementType)
    return false;
  auto *ReleaseArray = dyn_cast_or_null<StrongReleaseInst>(getInstAfter(Call));
  if (!ReleaseArray && MayHaveBridgedObjectElementType)
    return false;
  if (ReleaseArray &&
      ReleaseArray->getOperand() != RetainArray->getOperand())
    return false;

There is no check in the last if if RetainArray is not nullptr even though it is
possible for it to be so.

Found by clang static analyzer.
2016-01-08 19:28:42 -08:00
Erik Eckstein
6ff2f09796 [SIL] Let alloc_stack return a single value.
Having a separate address and container value returned from alloc_stack is not really needed in SIL.
Even if they differ we have both addresses available during IRGen, because a dealloc_stack is always dominated by the corresponding alloc_stack in the same function.

Although this commit quite large, most changes are trivial. The largest non-trivial change is in IRGenSIL.

This commit is a NFC regarding the generated code. Even the generated SIL is the same (except removed #0, #1 and @local_storage).
2016-01-06 17:35:27 -08:00
practicalswift
1339b5403b Consistent use of header comment format.
Correct format:
//===--- Name of file - Description ----------------------------*- Lang -*-===//
2016-01-04 13:26:31 +01:00
Zach Panzarino
e3a4147ac9 Update copyright date 2015-12-31 23:28:40 +00:00
practicalswift
f34df59dc6 Remove duplicate #include:s 2015-12-29 12:12:26 +01:00
practicalswift
fa0b339a21 Fix typos. 2015-12-26 17:51:59 +01:00
practicalswift
22e10737e2 Fix typos 2015-12-26 01:19:40 +01:00
practicalswift
4ff12be924 Fix typos. 2015-12-24 14:26:57 +01:00
ken0nek
fcd8fcee91 Convert [Cc]an not -> [Cc]annot 2015-12-23 00:55:48 +09: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
Arnold Schwaighofer
386dd0f171 COWArrayOpt: Handle patterns of 2d array accesses after more aggresive alias analysis
Make sure we handle a code pattern that we will encounter after Erik's upcoming
alias analysis changes.

rdar://23938778
2015-12-17 15:30:51 -08:00
practicalswift
8ab8847684 Fix typos. 2015-12-16 22:09:32 +01:00
Arnold Schwaighofer
ba2de2d88d Use SILLoop::canDuplicate in the ArraySpecializer 2015-12-14 12:03:41 -08: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
a50b8cd659 Merge pull request #510 from practicalswift/fix-typos-14
Fix typos (14 of 30)
2015-12-14 01:07:49 -08:00
Michael Gottesman
b838e121ed Merge pull request #502 from practicalswift/fix-typos-6
Fix typos (6 of 30)
2015-12-13 19:03:41 -06:00
practicalswift
4e757bd493 Fix typo: intialization → initialization 2015-12-14 00:11:59 +01:00
practicalswift
f17ecbc848 Fix typo: guarantueed → guaranteed 2015-12-14 00:11:49 +01:00
practicalswift
6b06eb9d17 Fix typo: completedly → completely 2015-12-14 00:11:24 +01:00
practicalswift
dc569363fd Fix typo: beeing → being 2015-12-14 00:11:18 +01:00
GauravDS
841092785a Fix typos
interefere => interfere
preceeding => preceding
happend => happened
refererence => reference
constains => contains
2015-12-13 03:09:10 +05:30
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