Erik Eckstein
d3c975391f
SIL: remove dump and print from SILValue
...
If you want to dump a SILValue from the debugger, use Value->dump()
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
Arnold Schwaighofer
924cc48e84
Add side effects for fix_lifetime
...
A fix_lifetime acts as a read on memory. A retain can move past it but the
ultimate release cannot move before it
2016-01-25 08:49:17 -08:00
practicalswift
71e00fefa1
[gardening] Fix typos: "word word" (two spaces) → "word word" (one space)
2016-01-24 21:27:16 +01:00
practicalswift
638a7c9474
[gardening] Avoid "var == true" and "var == false"
2016-01-23 19:57:07 +01:00
practicalswift
0d40662332
[gardening] Consistent use of header pattern
2016-01-23 12:19:51 +01:00
practicalswift
8efa5f587e
[gardening] Remove "-*- C++ -*-" tag from .cpp files
...
Emacs assumes .h files are C files by default which is why the
tag "-*- C++ -*-" is needed.
.cpp files do not have this problem.
2016-01-23 12:09:32 +01:00
practicalswift
33312eac6b
[gardening] Remove unreachable/unused/redundant code
...
* Make parameter naming in forward declaration match definition
* Remove unused argument to function persistAsync(…)
* Remove unused enum ShouldHalt
* Remove unused enum class IsProtocol
* Remove unused function dumpTypeSubstitutionMap()
* Remove unused function template getFirstPairElt(…)
* Remove unused method addConstantWordInWords(…)
* Remove unused method asExistentialTI()
* Remove unused method currentTrackedState()
* Remove unused method getNumBodyParameters()
* Remove unused method getSuccIndex()
* Remove unused method getTypeOfDeclReference(…)
* Remove unused method hasStructWithAtMostOneNonTrivialField(…)
* Remove unused method initForDirectValues()
* Remove unused method nextIfNot(…)
* Remove unused method overwriteLoweredValue(…)
* Remove unused method removeColumn(…)
* Remove unused methods HasSingleDecl() and GetFirstDecl()
* Remove unused methods overwriteLoweredExplosion(…) and setLoweredSingleValue(…)
* Remove unused methods requireRetainablePointerValue(…), getMethodSelfInstanceType(…) and isSelfArchetype(…)
* Remove unused methods setAsEmptyDirect(), setAsSingleDirectUnmanagedFragileValue(…), setAsIndirectAddress(…) and getDirectValues()
* Remove unused struct CachedMemberInfo
* Remove unused struct CallEdit
* Remove unused struct ErrorImportInfo
* Remove unused synonym ConformancePair
* Remove unused variable SemaInfo
* Remove unused variable localDeclNameNode
* Remove unused variables kindToken and kindLoc
2016-01-22 09:43:24 +01:00
Erik Eckstein
f2c0283437
Simplify DebugUtils
...
With the changes in SILValue there is no need for template functions in DebugUtils anymore.
2016-01-21 16:04:30 -08: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
Xin Tong
63713e044e
Port alias analysis to use the NewProjection from the (old) Projection. This passes all validation
...
tests, including alias analysis SIL tests based on AAdumper.
2016-01-21 09:29:08 -08:00
practicalswift
6d0eee9b8c
Remove unused variables.
2016-01-21 10:33:17 +01: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
6099702789
Fixes requested by Jordan when reviewing 389238e801.
...
These were all small fixes suggested by Jordan. All of the changes are cosmetic
except for 1 removal of a sort that was not needed.
2016-01-15 22:58:10 -08:00
Erik Eckstein
1c781f8470
AliasAnalysis: handle project_box in TBAA
2016-01-15 12:35:29 -08:00
Erik Eckstein
25e52a0ba0
treat project_box as projection in SILValue and SideEffectAnalysis
2016-01-15 12:35:29 -08:00
Erik Eckstein
e5ad57c77b
EscapeAnalysis: less conservative handling of @box types and partial_apply with @box arguments
2016-01-15 12:35:29 -08:00
Michael Gottesman
551b94b7ae
[rc-id] Make RCIdentity strip off single-pred arguments.
...
This was already done in a few different places in the compiler. There is no
reason not to have it in RCIdentity directly.
rdar://24156136
2016-01-14 18:59:42 -08:00
Michael Gottesman
2f3709443d
[rc-id] Make RCIdentity strip off single-pred arguments.
...
In a bunch of use-cases we use stripSinglePredecessorArgs to eliminate this
case. There is no reason to assume that this is being done in the caller of
RCIdentity. Lets make sure that we handle this case here.
rdar://24156136
2016-01-14 18:19:54 -08:00
Erik Eckstein
eff88d8703
EscapeAnalysis: don't crash in case a function_ref is passed to a C-function pointer argument.
...
Fixes rdar://problem/24183323
2016-01-14 15:20:13 -08:00
Erik Eckstein
5b31b94db4
EscapeAnalysis: handle strong_pin and strong_unpin instructions.
2016-01-13 17:03:10 -08:00
Erik Eckstein
dc84f4151b
EscapeAnalysis: add API for checking the escape status of parameters of a function call.
2016-01-13 17:03:10 -08:00
Michael Gottesman
f93b8559f5
[gardening] Add some textual flags and organize the code a little bit. NFC.
2016-01-12 14:43:19 -08:00
Michael Gottesman
1b83009456
[gardening][rc-id] Move the main RCIdentityRoot analysis entry point into the RCIdentityRoot analysis section.
2016-01-12 14:31:10 -08:00
Erik Eckstein
7b5741df71
SideEffectAnalysis: consider that @callee_owned calls implicitly release the context.
...
fixes rdar://problem/24112977
2016-01-11 17:32:15 -08:00
Michael Gottesman
5b1ebe12a9
Remove the case 'Invalid' from the TermKind enum and just use an unreachable in the ValueKind -> TermKind switch instead.
...
In all of the cases where this is being used, we already immediately perform an
unreachable if we find a TermKind::Invalid. So simplify the code and move it
into the conversion switch itself.
2016-01-11 15:44:05 -08:00
Michael Gottesman
7b17debfbd
Revert "[loop-region] Add in an assert that we should always have a block result for getRegionForNonLocalSuccessors. NFC."
...
This reverts commit 81e7bdfe1b .
This is not true in non-loop canonicalized SIL. It is true in loop-canonicalized
SIL though. So I need to fix the test to avoid the assert.
2016-01-07 20:46:12 -08:00
Michael Gottesman
81e7bdfe1b
[loop-region] Add in an assert that we should always have a block result for getRegionForNonLocalSuccessors. NFC.
2016-01-07 20:32:05 -08:00
Erik Eckstein
9ad406d5d6
Remove the local_storage type attribute and SIL value category.
...
They are not used anymore as alloc_stack now returns a single value.
2016-01-06 17:35:27 -08:00
practicalswift
ca92efc8e6
Use consistent formatting of header comments.
...
Correct format:
```
//===--- Name of file - Description ----------------------------*- Lang -*-===//
```
Notes:
* Comment line should be exactly 80 chars.
* Padding: Pad with dashes after "Description" to reach 80 chars.
* "Name of file", "Description" and "Lang" are all optional.
* In case of missing "Lang": drop the "-*-" markers.
* In case of missing space: drop one, two or three dashes before "Name of file".
2016-01-04 23:00:53 +01:00
practicalswift
1339b5403b
Consistent use of header comment format.
...
Correct format:
//===--- Name of file - Description ----------------------------*- Lang -*-===//
2016-01-04 13:26:31 +01:00
practicalswift
f91525a10f
Consistent placement of "-*- [language] -*-===//" in header.
2016-01-04 09:46:20 +01:00
Michael Gottesman
3d8433b7f6
[arc] Add in a new semantics attribute called "arc.programtermination_point" and document it.
...
If this semantic tag is applied to a function, then we know that:
- The function does not touch any reference counted objects.
- After the function is executed, all reference counted objects are leaked
(most likely in preparation for program termination).
This allows one, when performing ARC code motion, to ignore blocks that contain
an apply to this function as long as the block does not have any other side
effect having instructions.
I have wanted to do this for a while but was stymied by lacking the ability to
apply multiple @_semantics attributes. This is now committed to trunk so I added
this attribute instead of pattern matching against fatalError (since there could
be other functions with this property).
rdar://19592537
2016-01-02 16:22:06 -06:00
Michael Gottesman
389238e801
Add support for multiple @_semantics attributes at the SIL level.
...
This is something that we have wanted for a long time and will enable us to
remove some hacks from the compiler (i.e. how we determine in the ARC optimizer
that we have "fatalError" like function) and also express new things like
"noarc".
2016-01-02 04:17:07 -06:00
Chris Lattner
2af78aede1
forward declare ASTWalker in ASTNode.h instead of including its header, NFC.
2015-12-31 21:05:13 -08:00
Zach Panzarino
e3a4147ac9
Update copyright date
2015-12-31 23:28:40 +00:00
practicalswift
149b50d901
Fix typos in code (non-comment/documentation typos).
2015-12-28 11:42:15 +01:00
practicalswift
fd70b26033
Fix typos in comments.
2015-12-28 02:15:34 +01:00
practicalswift
d89b4d45e1
Fix typos in code (non-comment typos).
2015-12-27 13:05:01 +01:00
practicalswift
fa0b339a21
Fix typos.
2015-12-26 17:51:59 +01:00
practicalswift
85e2e6eb9a
Fix a vs. an
2015-12-26 14:40:16 +01:00
practicalswift
22e10737e2
Fix typos
2015-12-26 01:19:40 +01:00
Xin Tong
f9450ea6ab
Avoid extraneous generation of AACache and MBCache keys
2015-12-24 09:24:56 -08:00
Xin Tong
47afcd4adc
Regenerate cache key after the valueenumeraor is invalidated. Exposed by another painful memory behavior cache bug
2015-12-24 00:30:11 -08:00
Erik Eckstein
c7e8cb0332
Remove now unused utility functions for escape checking.
...
Those functions were replaced by EscapeAnalysis.
2015-12-23 16:48:41 -08:00
Erik Eckstein
f963b5ce70
AliasAnalysis: conservatively assume @inout may alias, part 2
...
Use the new swift::isNotAliasingArgument utility function to check for a not-aliased arguments.
2015-12-23 16:12:42 -08:00
Erik Eckstein
f8c82889b8
Fix wrong combination of MemoryBehavior.
...
Instead of taking the maximum we need to handle the special case MayRead + MayWrite = MayReadWrite
2015-12-23 13:50:08 -08:00
Erik Eckstein
c5ebaee297
EscapeAnalysis: rename utility function for checking reference semantics and use it in canObjectOrContentEscapeTo
...
This makes canObjectOrContentEscapeTo less conservative when dealing with addresses of references.
2015-12-23 08:33:44 -08:00