Commit Graph

40 Commits

Author SHA1 Message Date
Evan Wilde
0aafd09835 F_None was renamed OF_None
This patch updates usages of F_None to OF_None, as LLVM changed that in
commit 3302af9d4c39642bebe64dd60a3aa162fefc44b2.
2021-06-23 10:36:39 -07:00
Alexis Laferrière
d67c98a62a [next] Update reference to initializeDwarfEHPreparePass
Fix rdar://73006157
2021-01-11 12:52:41 -08:00
Arnold Schwaighofer
9db5916d1a Adjust to LLVM change: InitTargetOptionsFromCodeGenFlags requires a triple 2020-10-21 06:16:06 -07:00
Robert Widmann
5481631baf Merge remote-tracking branch 'upstream/master' into master-next 2020-04-17 20:27:23 -07:00
Robert Widmann
1f2346d381 [NFC] Drastically Reduce The Scope of the Global Context
Delete all of the formalism and infrastructure around maintaining our own copy of the global context. The final frontier is the Builtins, which need to lookup intrinsics in a given scratch context and convert them into the appropriate Swift annotations and types. As these utilities have wormed their way through the compiler, I have decided to leave this alone for now.
2020-04-17 14:02:45 -07:00
Robert Widmann
d03e991ec6 [NFC] Internalize the LLVMContext for LLVMOpt 2020-04-17 12:24:33 -07:00
Arnold Schwaighofer
cc8653d86e Adjust to llvm change ac1d23ed7de01fb3a18b340536842a419b504d86 2020-03-18 16:24:23 -07:00
Bob Wilson
730cc83af8 master-next: Change to include CommandFlags.inc (instead of .def)
LLVM r329840 renamed CommandFlags.def to CommandFlags.inc.
Update Swift to match.
2018-04-16 17:07:12 -07:00
swift-ci
c95feb723b Merge remote-tracking branch 'origin/master' into master-next 2018-02-28 20:12:23 -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
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
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
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
practicalswift
00de8a36c3 [gardening] Fix recently introduced typo: "dynamicism" → "dynamism" 2016-04-09 23:50:51 +02: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
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