Commit Graph

629 Commits

Author SHA1 Message Date
Michael Gottesman
aa035e9563 Rename disable-llvm-arc-opts => disable-swift-specific-llvm-optzns and make sure that we actually disable /all/ LLVM passes.
For instance, we were always running merge functions unconditionally if -O was
passed.

rdar://40097698
2018-05-15 16:18:16 -07:00
swift-ci
65bf732c9b Merge remote-tracking branch 'origin/master' into master-next 2018-05-14 13:28:49 -07:00
Michael Gottesman
08fc956382 Make our LLVM level passes obey disable-llvm-optzns.
We weren't performing the right check here... I added a test that tests both
positive/negative cases.

rdar://40097698
2018-05-14 12:09:06 -07:00
swift-ci
e5203d4b2b Merge remote-tracking branch 'origin/master' into master-next 2018-04-24 23:09:20 -07:00
Slava Pestov
7e4da528a6 IRGen: Remove collectLinkLibrariesFromExternals()
It doesn't appear to do anything.
2018-04-24 20:30:17 -07:00
swift-ci
4b5a4a963d Merge remote-tracking branch 'origin/master' into master-next 2018-04-11 10:08:16 -07:00
Doug Gregor
61e9cf8f1d [IRGen] Centralize the hack to collect autolink libraries from externals.
We had three copies of this code, each of which did a bit more work than
was actually necessary. Consolidate them and avoid calling
`collectLinkLibraries()` on a given module more than once within this
path.
2018-04-10 21:17:10 -07:00
swift-ci
0f92d894a8 Merge remote-tracking branch 'origin/master' into master-next 2018-04-06 14:15:23 -07:00
Arnold Schwaighofer
ae0f98d601 IRGen: Ensure collocation of relative pointers in resilient witness tables
Ensure collocation by recording the dependence between witness table and
witness before functions are processed. Debug info of inlined function
scopes can reference the witness and will cause the wrong IRGenModule to
be associated before lazy witness tables are processed.

No, I am not sure that this is the only instance of this but the same
solution can apply to other instances if we find them.

rdar://39116991
2018-04-06 10:03:54 -07:00
swift-ci
ab78849797 Merge remote-tracking branch 'origin/master' into master-next 2018-02-28 11:51:52 -08:00
swift-ci
78a4e268b3 Merge remote-tracking branch 'origin/master' into master-llvm-swift5-transition 2018-02-28 11:41:18 -08:00
David Ungar
4866df6dfd Move SupplementaryOutputs into each InputFile. 2018-02-28 09:41:49 -08:00
swift-ci
c93e69746b Merge remote-tracking branch 'origin/master' into master-next 2018-02-21 10:59:05 -08:00
swift-ci
6920f18849 Merge remote-tracking branch 'origin/master' into master-llvm-swift5-transition 2018-02-21 10:59:03 -08:00
Pavel Yaskevich
9d6dc72e15 [IRGen/Reflection] Emit built-in reflection metadata in JIT mode
Since Mirrors are using swift_getFieldAt we need built-in type
metadata present in JIT/REPL mode as well, otherwise some of the
types are going to become unprintable.
2018-02-20 18:20:09 -08:00
swift-ci
7a3969774e Merge remote-tracking branch 'origin/master' into master-llvm-swift5-transition 2018-02-16 12:58:13 -08:00
Bob Wilson
43f8f18d3d Fix whitespace changes introduced during a merge conflict resolution
Xi edited this file to resolve a conflict (87d57fdc51) and his editor was
set to automatically remove all trailing whitespace. This divergence from
master is causing more conflicts, so I'm removing these unexpected
whitespace differences.
2018-02-16 12:37:55 -08:00
swift-ci
e2972f1279 Merge remote-tracking branch 'origin/master' into master-next 2018-02-15 23:49:28 -08:00
Bob Wilson
d8dd04796a master-next: fix bad merge in d052a53ce6 2018-02-15 21:51:57 -08:00
Bob Wilson
22e1a7da96 master-next: Pass module references to bitcode writer to match LLVM r325155. 2018-02-15 20:58:11 -08:00
David Ungar
026b850d0c Only pass output filename and main input file name for debugging into IRGenModule constructor. 2018-02-15 20:52:26 -07:00
David Ungar
dec78900cd Only use supplementary outputs for first parallel-generated input. 2018-02-15 15:34:55 -07:00
David Ungar
e7a120f9b3 Avoid copying strings and PrimarySpecificPaths. 2018-02-15 15:34:55 -07:00
David Ungar
fec411e9bc reformatted 2018-02-15 15:34:55 -07:00
David Ungar
1f9a4f3591 Pass around arguments for primary-specific filenames.
Get rid of IRGenOpts attributes that won’t work for batch mode and also remove fakeNamesStub.
2018-02-15 15:34:55 -07:00
Arnold Schwaighofer
2bfeb2fbcc Adapt to llvm api change CodeModel::Default is now modeled as Optional<CodeModel::Mode>.None 2018-02-15 12:53:40 -08:00
Xi Ge
87d57fdc51 Merge remote-tracking branch 'apple/master' into apple-master-llvm-swift5-transition 2018-02-15 11:22:55 -08:00
Xi Ge
d052a53ce6 Merge remote-tracking branch 'apple/master' into apple-master-next 2018-02-15 11:20:08 -08:00
Arnold Schwaighofer
2d58f08142 Use clang's effective llvm triple for IR generation
Instead of using the target that was passed to the driver. Use the target from
the clang importer that might have been changed by clang (i.e armv7 to thumbv7
on darwin)

rdar://32599805
2018-02-14 15:45:43 -08:00
swift-ci
e416454ed5 Merge remote-tracking branch 'origin/master' into master-llvm-swift5-transition 2018-01-09 23:18:50 -08:00
swift-ci
f0c2d65e1c Merge remote-tracking branch 'origin/master' into master-next 2018-01-09 23:09:03 -08:00
swift-ci
ea489cead0 Merge pull request #13844 from DougGregor/runtime-protocol-name-lookup 2018-01-09 23:06:09 -08:00
Bob Wilson
1b55b85e2b Merge remote-tracking branch 'origin/master' into master-llvm-swift5-transition 2018-01-09 16:12:10 -08:00
Doug Gregor
0f4963dba8 [IRGen] Put references to all emitted protocols into a special section.
Introduce a new section that contains (relative) references to all of the
Swift protocol descriptors emitted into this module. We'll use this to
find protocol descriptors by name.
2018-01-09 16:10:18 -08:00
Ben Langmuir
627d6d0a9f Merge remote-tracking branch 'origin/master' into master-next
Conflicts:
	lib/IRGen/IRGen.cpp
2018-01-09 10:54:33 -08:00
John McCall
3c54c0edfc IRGen and basic optimizer support for coroutines. 2018-01-09 11:35:09 -05:00
swift-ci
0302515cf0 Merge remote-tracking branch 'origin/master' into master-next 2017-12-18 12:48:55 -08:00
David Ungar
51d3165874 NFC: Clarifying uses of NumThreads.
Add hasMultipleGMs predicate to SILOptions.
Rename parameters to TBD file handling to better reflect abstraction boundary.

fix
2017-12-16 13:58:01 -08:00
Bob Wilson
8d1513a260 master-next: Update for LLVM TargetSubtargetInfo.h moving to CodeGen.
In LLVM r318490, the TargetSubtargetInfo.h header file was moved from the
Target directory to the CodeGen directory. rdar://problem/35634771
2017-11-19 08:45:11 -08:00
swift-ci
d3b8ffc42a Merge remote-tracking branch 'origin/master' into master-next 2017-11-14 12:09:04 -08:00
Erik Eckstein
90c21be191 Unify the implementation of optimization mode in various option classes.
This commit is mostly refactoring.

*) Introduce a new OptimizationMode enum and use that in SILOptions and IRGenOptions
*) Allow the optimization mode also be specified for specific SILFunctions. This is not used in this commit yet and thus still a NFC.

Also, fixes a minor bug: we didn’t run mandatory IRGen passes for functions with @_semantics("optimize.sil.never")
2017-11-14 11:25:02 -08:00
Bob Wilson
837a8516f0 Merge remote-tracking branch 'origin/master' into master-next 2017-10-19 20:56:04 -07:00
Saleem Abdulrasool
8ab7956c42 IRGen: do not use the Large Code Model on Win64
The large code model is not necessary.  Large Address Aware should be
sufficient for dealing with the higher address ranges.  Using the large
code model breaks the DLL storage semantics on Windows.  With this we
are able to build most of the standard library for all variants of
Windows.

Addresses SR-6150!
2017-10-17 15:05:53 -07:00
swift-ci
c6bb8ba0f2 Merge remote-tracking branch 'origin/master' into master-next 2017-10-06 10:09:52 -07:00
Michael Gottesman
723c6212f2 Run ObjCARCContract when optimizing no matter the IRGenOutputKind.
Previously, we were just running ObjCARCContract when codegening. This is out of
character with the rest of the LLVM passes in Swift, namely that after these
have run, an IR pass no longer contains any compiler intrinsics. This can be
seen by SwiftARCContract running in the -O pipeline.

This commit harmonizes the behavior here.

For testing purposes, I added a flag that disables the running of
ObjCARCContract for testing purposes.

rdar://34824507
2017-10-06 08:59:58 -07:00
swift-ci
afb3d37547 Merge remote-tracking branch 'origin/master' into master-next 2017-10-03 12:29:09 -07:00
Arnold Schwaighofer
c61af365ed Truly disable thumb emission
Interpreter support for thumb is not yet properly implemented/tested.
Disable thumb emission.

This change is necessary because LLVM now uses the features string in the
metadata. This features string contains '+thumb'.

This is a follow-up to 034241e440.

rdar://32599805
rdar://34781037 (tests that expect non-thumb instructions are failing)
2017-10-03 11:12:13 -07:00
swift-ci
1fb83060df Merge remote-tracking branch 'origin/master' into master-next 2017-09-23 10:29:35 -07:00
Saleem Abdulrasool
7bd2256120 runtime: clean up last of -Wqual-cast warnings
This fixes up the remaining cast qualifier warnings from GCC 6.  Use
multiple casts to adjust the const qualification.  Prefer C++ style
casts.  NFC.
2017-09-22 14:14:13 -07:00
swift-ci
5702d522ab Merge remote-tracking branch 'origin/master' into master-next 2017-09-13 06:29:47 -07:00