Commit Graph

2818 Commits

Author SHA1 Message Date
swift-ci
cea7fc479a Merge remote-tracking branch 'origin/master' into master-llvm-swift5-transition 2018-01-11 18:18:40 -08:00
adrian-prantl
ecf9ee749d Merge pull request #13818 from vedantk/empty-locs
[DebugInfo] Add a free helper to get empty locations, NFC
2018-01-11 18:14:37 -08:00
swift-ci
d6ed3aada2 Merge remote-tracking branch 'origin/master' into master-next 2018-01-10 23:50:44 -08:00
swift-ci
1688894110 Merge remote-tracking branch 'origin/master' into master-llvm-swift5-transition 2018-01-10 23:18:14 -08:00
Slava Pestov
005267f2b0 SIL: Remove obsolete comments from FormalLinkage.h 2018-01-10 21:32:54 -08:00
swift-ci
9f30c7f6d2 Merge remote-tracking branch 'origin/master' into master-llvm-swift5-transition 2018-01-09 22:11:00 -08:00
swift-ci
67d8ca94c4 Merge remote-tracking branch 'origin/master' into master-next 2018-01-09 22:07:41 -08:00
swift-ci
212e72dfce Merge pull request #13780 from gottesmm/pr-5257f0f76ea8f8dcc8e00aff2734cf20d6bcdd50 2018-01-09 19:13:01 -08:00
Michael Gottesman
8160913cb1 [temp-rvalue] Teach the temprvalue to ignore @in_guaranteed uses.
This is a pattern that comes up very often in an all +0 normal argument
convention world.

rdar://34222540
2018-01-09 18:25:06 -08:00
Vedant Kumar
d60ff05265 Rename getEmptyLocation to getCompilerGeneratedLocation 2018-01-09 12:38:45 -08:00
swift-ci
112a63f3d1 Merge remote-tracking branch 'origin/master' into master-next 2018-01-09 09:09:30 -08:00
swift-ci
d9f7cf4a09 Merge remote-tracking branch 'origin/master' into master-llvm-swift5-transition 2018-01-09 08:59:10 -08:00
Mark Lacey
944a5c6cb6 IUO: Remove some uses of the two-param form of OptionalType::get.
These are cases where it's clearly always identical to just using the
single-parameter form of OptionalType::get.
2018-01-09 03:19:29 -08:00
Vedant Kumar
e33f3b663d [DebugInfo] Add a free helper to get empty locations, NFC 2018-01-08 17:59:16 -08:00
swift-ci
2e2238af3e Merge remote-tracking branch 'origin/master' into master-llvm-swift5-transition 2018-01-08 15:38:35 -08:00
swift-ci
eb0af112db Merge remote-tracking branch 'origin/master' into master-next 2018-01-08 15:29:33 -08:00
Andrew Trick
abedb192bc Rename canUnsafeCastValue to checkABIForUnsafeScalarCast and comment.
This is an ABI-dependent routine, so at least should have ABI in the name.  In
the future, the compiler may introduce new ABI layout rules for select types
based on the deployment target. Code like this needs to be reviewed at that time.

Clarify the comments.
2018-01-08 14:17:36 -08:00
swift-ci
cc373f9c30 Merge remote-tracking branch 'origin/master' into master-llvm-swift5-transition 2018-01-08 12:27:47 -08:00
swift-ci
331f02938f Merge remote-tracking branch 'origin/master' into master-next 2018-01-08 11:29:35 -08:00
Andrew Trick
1390f917e5 [nfc] Remove some unused SILBuilder methods. 2018-01-08 11:26:56 -08:00
swift-ci
6fbbb779de Merge remote-tracking branch 'origin/master' into master-next 2018-01-05 17:29:44 -08:00
Vedant Kumar
c6bd848489 [Coverage] Assign profilers to closures without an inherited profiler
This is a step towards being able to report coverage for closures in
member initializer expressions. These closures do not inherit a
profiler, so they need a fresh one.

We currently treat initializer expressions which aren't closures as a
part of the constructor. This doesn't work for closures because the
constructor's profiler may not be available at the time the closure is
created.
2018-01-05 17:20:20 -08:00
Vedant Kumar
6debe84674 [Coverage] Record PGO function name in SILCoverageMap
This simplifies the lowering of instrprof_increment by getting rid of a
call to llvm::getPGOFuncName().
2018-01-05 17:20:20 -08:00
Vedant Kumar
54f3754337 [Coverage] Clean up a few classes, NFC
Run clang-format, delete some dead code, and fix a few naming
inconsistencies.
2018-01-05 17:20:20 -08:00
Vedant Kumar
dd560d2aa6 [Coverage] Refactor SIL generation for profiling
This patch moves the ownership of profiling state from SILGenProfiling
to SILFunction, where it always belonged. Similarly, it moves ownership
of the profile reader from SILGenModule to SILModule.

The refactor sets us up to fix a few outstanding code coverage bugs and
does away with sad hacks like ProfilerRAII. It also allows us to locally
guarantee that a profile counter increment actually corresponds to the
SILFunction at hand.

That local guarantee causes a bugfix to accidentally fall out of this
refactor: we now set up the profiling state for delayed functions
correctly. Previously, we would set up a ProfilerRAII for the delayed
function, but its counter increment would never be emitted :(. This fix
constitutes the only functional change in this patch -- the rest is NFC.

As a follow-up, I plan on removing some dead code in the profiling
logic and fixing a few naming inconsistencies. I've left that for later
to keep this patch simple.
2018-01-05 17:20:20 -08:00
swift-ci
0562c2e79d Merge remote-tracking branch 'origin/master' into master-next 2018-01-03 22:49:51 -08:00
swift-ci
32c3818670 Merge remote-tracking branch 'origin/master' into master-next 2018-01-03 22:09:50 -08:00
Vedant Kumar
cccee1df03 Revert "[Coverage] Refactor SIL generation for profiling" 2018-01-03 21:57:49 -08:00
Bob Wilson
f9497f5649 master-next: Update phi iteration for the LLVM SSAUpdater change in r321783
This replaces the previous solution that requires non-upstream changes
to LLVM.
2018-01-03 19:08:49 -08:00
Mark Lacey
7c49bc9733 Revert "[Coverage] Clean up a few classes, NFC" 2018-01-03 18:51:28 -08:00
swift-ci
aed0cb9541 Merge remote-tracking branch 'origin/master' into master-next 2018-01-03 17:49:52 -08:00
Vedant Kumar
e875efa4ae [Coverage] Clean up a few classes, NFC
Run clang-format, delete some dead code, and fix a few naming
inconsistencies.
2018-01-03 16:46:18 -08:00
swift-ci
641e5defb5 Merge remote-tracking branch 'origin/master' into master-next 2018-01-03 14:29:19 -08:00
David Zarzycki
1ebc8e95f7 Merge pull request #13691 from davezarzycki/nfc_perf_getDesugaredType2
[AST] Perf: Improve getDesugaredType() efficiency
2018-01-03 17:20:01 -05:00
swift-ci
ac14a7f453 Merge remote-tracking branch 'origin/master' into master-next 2018-01-03 12:49:09 -08:00
Vedant Kumar
aba9d53736 [Coverage] Refactor SIL generation for profiling
This patch moves the ownership of profiling state from SILGenProfiling
to SILFunction, where it always belonged. Similarly, it moves ownership
of the profile reader from SILGenModule to SILModule.

The refactor sets us up to fix a few outstanding code coverage bugs and
does away with sad hacks like ProfilerRAII. It also allows us to locally
guarantee that a profile counter increment actually corresponds to the
SILFunction at hand.

That local guarantee causes a bugfix to accidentally fall out of this
refactor: we now set up the profiling state for delayed functions
correctly. Previously, we would set up a ProfilerRAII for the delayed
function, but its counter increment would never be emitted :(. This fix
constitutes the only functional change in this patch -- the rest is NFC.

As a follow-up, I plan on removing some dead code in the profiling
logic and fixing a few naming inconsistencies. I've left that for later
to keep this patch simple.
2018-01-03 11:18:40 -08:00
David Zarzycki
77a29c9551 [AST] Perf: Improve getDesugaredType() efficiency
Make getDesugaredType() as fast as possible for now. With the old way:

1) Switching over the sugared types turned into a frequently
   mispredicted branch because the sugar in the type system is random
   as far as the processor is concerned.
2) Storing the underlying/singlely-desugared type at different offsets
   in memory adds more code bloat and misprediction.

Short of a major redesign to avoid pointer chasing, this is probably as
fast as the method will get.
2018-01-03 09:45:48 -05:00
swift-ci
ed1cf3bc48 Merge remote-tracking branch 'origin/master' into master-next 2018-01-02 15:29:18 -08:00
Chris Lattner
415cd50ba2 Reduce array abstraction on apple platforms dealing with literals (#13665)
* Reduce array abstraction on apple platforms dealing with literals

Part of the ongoing quest to reduce swift array literal abstraction
penalties: make the SIL optimizer able to eliminate bridging overhead
 when dealing with array literals.

Introduce a new classify_bridge_object SIL instruction to handle the
logic of extracting platform specific bits from a Builtin.BridgeObject
value that indicate whether it contains a ObjC tagged pointer object,
or a normal ObjC object. This allows the SIL optimizer to eliminate
these, which allows constant folding a ton of code. On the example
added to test/SILOptimizer/static_arrays.swift, this results in 4x
less SIL code, and also leads to a lot more commonality between linux
and apple platform codegen when passing an array literal.

This also introduces a couple of SIL combines for patterns that occur
in the array literal passing case.
2018-01-02 15:23:48 -08:00
swift-ci
684ef2cd9a Merge remote-tracking branch 'origin/master' into master-next 2017-12-30 22:49:12 -08:00
Chris Lattner
de289752fe Implement a few silcombine transformations for arrays (#13652)
* Implement a few silcombine transformations for arrays

 - Useless existential_ref <-> class conversions.
 - mark_dependence_inst depending on uninteresting instructions.
 - release(init_existential_ref(x)) -> release(x) when hasOneUse(x)
 - Update COWArrayOpt to handle the new forms generated by this.

these aren't massive performance wins, but do shrink the size of SIL when
dealing with arrays.

* Generalize testcase to work on linux and on mac when checking stdlib is enabled.
2017-12-30 22:30:37 -08:00
swift-ci
00cf2a4070 Merge remote-tracking branch 'origin/master' into master-next 2017-12-28 08:49:22 -08:00
swift-ci
d2dc653420 Merge pull request #13637 from davezarzycki/sil_nfc_remove_boilerplate3 2017-12-28 08:46:48 -08:00
swift-ci
ea5116e40b Merge remote-tracking branch 'origin/master' into master-next 2017-12-28 08:29:21 -08:00
David Zarzycki
68c696dbc1 [SIL] NFC: Replace boilerplate projection with swift::ArrayRefView 2017-12-28 09:51:29 -05:00
David Zarzycki
da238539f5 [Basic] NFC: Inline bitfield cleanup
1) Remove SWIFT_INLINE_BITS boilerplate. Now that we're not using anonymous/transparent unions, we don't need the
SWIFT_BITFIELD_BITS macro.
2) Refine the the bitfield size check to better support templated bitfields.
3) Refine the SIL templated bitfields to not be prematurely "full".
2017-12-28 09:20:31 -05:00
swift-ci
f8dde3619a Merge remote-tracking branch 'origin/master' into master-next 2017-12-27 10:49:23 -08:00
David Zarzycki
3910c0d211 [SIL] NFC: Remove TailAllocatedOperandList template
Please use InstructionBaseWithTrailingOperands template now. It is more type safe and more space efficient.
2017-12-27 11:18:54 -05:00
David Zarzycki
679538b72c [SIL] NFC: Migrate SelectInstBase subclasses to InstructionBaseWithTrailingOperands 2017-12-27 11:14:17 -05:00
David Zarzycki
d532fdefe0 [SIL] NFC: Migrate AllocRefInstBase subclasses to InstructionBaseWithTrailingOperands 2017-12-27 08:00:20 -05:00