Commit Graph

42 Commits

Author SHA1 Message Date
swift-ci
9e935e1a9e Merge remote-tracking branch 'origin/master' into master-llvm-swift5-transition 2018-02-28 20:00:51 -08:00
Jordan Rose
3cd9f166bc Don't spend time initializing LLVM when running the driver (#14896)
Tiny start-up time optimization noticed while looking at how we do
PrettyStackTraceProgram. Also add PrettyStackTraceProgram to a few
more of our testing tools, via the new PROGRAM_START macro.
2018-02-28 19:56:19 -08:00
Michael Gottesman
668f0688a8 [upstream-update] mv include/Codegen/CommandFlags.{h,def}
rdar://33713560
2017-11-30 22:06:39 -08:00
swift-ci
d3b8ffc42a Merge remote-tracking branch 'origin/master' into master-next 2017-11-14 12:09:04 -08:00
Erik Eckstein
8033476b64 Function-level optimization attributes.
For now these are underscored attributes, i.e. compiler internal attributes:
@_optimize(speed)
@_optimize(size)
@_optimize(none)

Those attributes override the command-line specified optimization mode for a specific function.
The @_optimize(none) attribute is equivalent to the already existing @_semantics("optimize.sil.never") attribute
2017-11-14 11:25:02 -08:00
Bob Wilson
d4eec9d1a7 master-next: Rename tool_output_file to match LLVM r314050. 2017-09-23 09:42:13 -07:00
Bob Wilson
19f9237d7c [master-next] More updates for LLVM r309911 CodeModel changes.
The default when creating a target machine should be to leave the
code model unspecified (at least that is the default argument value).
The previous change (7526d07525) also missed one place that needed
to be updated.
2017-08-03 18:44:10 -07:00
Bob Wilson
9dac6f3ab4 Change swift-llvm-opt to match LLVM r303360.
This uses the same changes from LLVM's tools/opt/opt.cpp.
2017-06-12 10:53:06 -07:00
Francis Ricci
dab9e96080 Adjust for LLVM SVN r303360
getTargetMachineCtor was removed in LLVM r303360.
2017-06-05 19:12:58 -04:00
practicalswift
6d1ae2a39c [gardening] 2016 → 2017 2017-01-06 16:41:22 +01:00
practicalswift
797b80765f [gardening] Use the correct base URL (https://swift.org) in references to the Swift website
Remove all references to the old non-TLS enabled base URL (http://swift.org)
2016-11-20 17:36:03 +01:00
Erik Eckstein
bd0d2bfed4 Remove the LLVM stack promotion pass and related SIL optimization logic.
It's not needed anymore because array buffers are now allocated with alloc_ref instead of a swift_bufferAllocate runtime call.
2016-09-16 11:02:19 -07:00
Dmitri Gribenko
fbb3cf35a5 Revert "New SIL instructions to support tail-allocated arrays in SIL." 2016-09-15 00:25:25 -07:00
Erik Eckstein
6ae818c9d1 Remove the LLVM stack promotion pass and related SIL optimization logic.
It's not needed anymore because array buffers are now allocated with alloc_ref instead of a swift_bufferAllocate runtime call.
2016-09-14 14:54:18 -07:00
Michael Gottesman
97a5e75bfb Merge pull request #3817 from compnerd/swift-llvm-opt
[upstream-update] swift-llvm-opt: adjust for SVN r276687
2016-08-30 22:58:29 -07:00
Michael Gottesman
fa1bb95923 Merge remote-tracking branch 'origin/master' into master-next 2016-08-30 19:50:12 -07:00
Michael Gottesman
7e2568dcf0 [cmake-components] Introduce a new API add_swift_host_tool for creating/initializing swift tool targets.
The main action here is to sink the creation of the installation rule for all of
the swift host tools into this API. In a latter commit, I will use this API to
create include and build rules for add_swift_host_tool.
2016-08-28 14:12:14 -07:00
Saleem Abdulrasool
2d50ed9ca3 [upstream-update] Link LLVMDebugInfoCodeView into 6 executable tools. (#4489)
All of these cases seem to need the symbols from LLVM's new CodeView library to
link.

The specific executables are:

1. Swift Driver.
2. SIL Extract.
3. SIL Opt.
4. Swift IDE Test.
5. Swift LLVM Opt.
6. LLDB Module Import Test
2016-08-26 02:20:45 -04:00
Saleem Abdulrasool
4410f55a47 swift-llvm-opt: adjust for SVN r276687
LLVM SVN r276687 ported the SymbolRewriter pass to the new PM.  This results in
the constructor being renamed.  Adjust the swift-llvm-opt tool accordingly.
2016-07-27 21:06:38 -07:00
Vedant Kumar
8dd7d147dd [stable-merge] [swift-llvm-opt] Pass RelocModel as an Optional 2016-06-27 11:14:27 -07:00
Michael Gottesman
8d00a6cb59 Merge remote-tracking branch 'origin/master' into master-next
Conflicts:
	stdlib/public/SDK/GameplayKit/CMakeLists.txt
	test/DebugInfo/bound-namealiastype.swift
	test/DebugInfo/structs.swift
	test/IRGen/c_globals.swift
	test/SourceKit/DocSupport/doc_clang_module.swift
	test/SourceKit/Indexing/index_with_clang_module.swift
	utils/update-checkout
2016-06-25 01:13:50 -07:00
Michael Gottesman
7803a440f6 Use COMPONENT_DEPENDS instead of LINK_LIBRARIES when linking against llvm libraries. 2016-05-20 21:30:27 -07:00
Erik Eckstein
f0022a5aac Add an LLVM pass to merge similar functions.
It's like LLVM's MergeFunctions pass, except that it can also merge functions which differ by some constants.
The intention is to merge specialized functions which only differ by metadata lookups. But it can also merge other types of functions.
It gives ~7% code size reducation for the stdlib.

There are still some open TODOs, e.g. to share common code with LLVM's MergeFunctions pass (currently much code is just copied).
2016-05-11 09:46:46 -07:00
Mark Lacey
859b779f15 Speculatively try a different fix for LLVMCoverage linker issues.
We're still hitting undefined symbols on Linux. Hopefully this clears
those up as well.
2016-05-06 17:02:22 -07:00
Mark Lacey
590cd6476e Link LLVMCoverage into tools that pull in references to it. 2016-05-03 21:41:54 -07:00
Michael Gottesman
0c1f6db23b [upstream-update] Add our own LLVM global context now that llvm::getGlobalContext() was removed upstream.
Swift relies on this for now. So create our own. This makes more sense
than trying to add back in the API (which is dead besides the c api) or
use the c api itself. We should probably consider not using a global
context like this.
2016-04-18 07:29:58 -07:00
Michael Gottesman
d89f252deb Merge remote-tracking branch 'origin/master' into master-next 2016-04-18 02:26:06 -07:00
practicalswift
00de8a36c3 [gardening] Fix recently introduced typo: "dynamicism" → "dynamism" 2016-04-09 23:50:51 +02:00
Michael Gottesman
140bcbc355 [upstream-update] Link LLVMDebugInfoCodeView into 6 executable tools.
All of these cases seem to need the symbols from LLVM's new CodeView library to
link.

The specific executables are:

1. Swift Driver.
2. SIL Extract.
3. SIL Opt.
4. Swift IDE Test.
5. Swift LLVM Opt.
6. LLDB Module Import Test
2016-03-26 02:01:19 -07:00
Erik Eckstein
9e28192ea3 Option -print-llvm-inline-tree for printing the inline-tree of the LLVM module.
This is useful to get information about what inlined functions contribute to the code size.
2016-02-10 12:14:23 -08: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
Kevin Payravi
db3affb8b0 Wording and grammar fixes in LLVMOpt.cpp comments 2015-12-03 14:01:20 -05:00
Erik Eckstein
ce848c648d And again: re-apply the StackPromotion commit 0dd045ca04.
The problem of the failure was a bug in instruction cloning, which is fixed in the previous commit.
2015-11-08 15:51:00 -08:00
Mark Lacey
e9718f619e Revert "Another try to re-apply the StackPromotion commit 0dd045ca04dcc10a33abf57f7e1b08260c4e3de1."
This reverts commit 7d70aa39dc because
it may be responsible for a bot breakage.
2015-11-07 16:51:24 -08:00
Erik Eckstein
7d70aa39dc Another try to re-apply the StackPromotion commit 0dd045ca04.
One bug fixed in escape analysis (previous commit) and one bug fixed in StackPromotion itself.
2015-11-06 16:16:36 -08:00
Arnold Schwaighofer
fd662987c8 Revert the StackPromotion pass - bots hit an assert.
Assertion failed: (NumUsePointsToFind > 0 && "There must be at least one
releasing instruction for an alloc"), function canPromoteAlloc

Revert "Fix comment for StackPromotion pass in SIL Passes"
Revert "Reapply the StackPromotion commit
0dd045ca04dcc10a33abf57f7e1b08260c4e3de1."

This reverts commit 3f4b1496bd and commit
199cfca13b.
2015-11-06 06:40:05 -08:00
Erik Eckstein
199cfca13b Reapply the StackPromotion commit 0dd045ca04.
This time with fixing a crash.
2015-11-05 22:01:27 -08:00
Erik Eckstein
d7b7fc76ea Revert "Add a stack promotion optimization."
This reverts commit 0dd045ca04.

StackPromotion crashes when compiling MatMult in stdlib-asserts configuration
2015-11-05 21:34:05 -08:00
Erik Eckstein
0dd045ca04 Add a stack promotion optimization.
It promotes allocations of native swift objects and array buffers to the stack if it is possible.
The SIL StackPromotion pass is the main part of the optimization. For details see comments there.
Unfortunately we need an additional LLVM pass to handle array buffers, which is not very nice.
I hope that we can get rid of it in future (again: for details see the comments in StackPromotion.cpp)

The optimization gives performance improvements in some benchmarks, mostly related to array literals:
ArrayLiteral: +12%
Combos: +16%
DictionaryLiteral: + 37%
RIPEMD: +10%
StringBuilder: +27%
StringInterpolation: +11%
And last but not least the new benchmark which is dedicated to test stack promotion:
ObjectAllocation: +52%
2015-11-05 16:52:59 -08:00
Michael Gottesman
4390d96adc Fix the linux build by appeasing the linker gods.
Swift SVN r32824
2015-10-22 07:05:34 +00:00
Michael Gottesman
53b64728f9 Add a new tool called swift-llvm-opts that is a custom opt driver for swift.
Now that one can not use analysis groups anymore on LLVM, we were given two
choices. Reinsert that dynamicism so we could via opt -load add in analyses /or/
just create our own version of opt. I decided to go with the later since it
enables us to simulate how IRGen sets up the LLVM pass pipeline exactly,
something we were unable to do before.

This also sets us up for whenever we need to respond to the new pass manager.

Swift SVN r32808
2015-10-21 21:45:20 +00:00