Commit Graph

305 Commits

Author SHA1 Message Date
Steven Wu
b56f541732 Merge pull request #85499 from cachemeifyoucan/eng/PR-164409895
[Caching] Fix multi-threaded WMO with MCCAS
2025-11-18 09:22:13 -08:00
Yuta Saito
8748213d52 Merge pull request #85524 from kateinoigakukun/yt/fix-non-reg2mem-rle-crash 2025-11-16 23:10:20 +09:00
Yuta Saito
32aa4d9aed sil-opt: Add flag to disable aggressive reg2mem mode 2025-11-15 12:12:46 +00:00
Steven Wu
b1d669bea1 [Caching] Fix multi-threaded WMO with MCCAS
MCCAS wasn't setup correctly when using parallel WMO. Make sure the
CAS ObjectStore and ResultCallbacks are passed to LLVM backend when
using parallel WMO.

rdar://164409895
2025-11-13 12:20:31 -08:00
Ian Anderson
5cdf2a879a [ABIChecker] Remove -iframework from swift-api-digester
-iframework is a holdover from when swift-api-digester was an LLVM tool. Now that everything has switched over to -Fsystem, -iframework can be removed.

rdar://153665579
2025-11-12 16:37:49 -08:00
Dylan Sturgeon
4b4f9f18fc Add an option for symbol graph to support long module names. (#83782)
Currently symbol graphs are always written in files that contain 1 to 2
module names. It's possible for Swift module names to be very long, so
combining 2 of them in file name like `module1@module2...` in the same
path component means the name can be too long for some file systems. The
new option `-symbol-graph-shorten-output-names` changes the symbol graph
output files to use a MD5 hash of the module name(s) as the filename and
outputs an additional JSON file with the original names mapped to the
real filename. The module names JSON can be used to construct a VFS
overlay with the original naming scheme.

fix #83723

I considered using vfsoverlay, which seems like a viable solution, but
the vfsoverlay options don't seem to apply to any of the outputs from
the compiler. When I set an overlay to remap the symbol graph file
outputs, the remapped external paths aren't used so the root problem of
too long file names remains.
2025-11-06 19:30:44 -08:00
Erik Eckstein
65e4c10113 Optimizer: remove the obsolete SpeculativeDevirtualization pass
This pass has been disabled since a very long time (because it's terrible for code size).
It does not work for OSSA. Therefore it cannot be enabled anymore (as is) once we have OSSA throughout the pipeline.
So it's time to completely remove it.
2025-10-13 10:49:17 +02:00
Yuta Saito
cd1db4a575 [autolink-extract] Update deduplication list for new Foundation, Testing, and WASI platform
We now have several new runtime libraries in the toolchain but they are
not listed in the autolink deduplication list. This can lead to an excessive
memory footprint when linking on platforms that use autolink-extract.

See https://github.com/swiftlang/swift/issues/58380
2025-10-09 06:57:48 +00:00
Michael Gottesman
e4fb8819d2 Merge pull request #84622 from gottesmm/pr-7065a633780e3a54b56563650e321ec0801bcb45
[sil-llvm-gen] Run Sema before we attempt to emit IR.
2025-10-07 00:57:05 -07:00
Michael Gottesman
3a96e99bd8 [sil-llvm-gen] Run Sema before we attempt to emit IR. 2025-10-06 15:17:26 -07:00
Mishal Shah
03a599c5be Merge pull request #84606 from swiftlang/rebranch
Merge clang 21.x rebranch into main
2025-10-02 20:17:05 -07:00
Michael Gottesman
d0d2163e0d [sil-llvm-gen] Allow for -Xllvm options to be passed to sil-llvm-gen.
Specifically, we ignore the -Xllvm bit and put the option into
FrontendOptions.LLVMArgs so that parts of CompilerInvocation that assumes that
-Xllvm flags will be placed there are actually there. We still pass through the
argument to llvm::cl so it gets set that way as well.
2025-10-01 09:26:57 -07:00
swift-ci
096394b77e Merge remote-tracking branch 'origin/main' into rebranch 2025-09-29 18:35:20 -07:00
Michael Gottesman
8c9f291f8b Merge pull request #84554 from gottesmm/pr-cd8090d1fb5e8fd9fbb2ae8dbdd5eb34dc24df99
[sil-llvm-gen] Add support for emitting IR before LLVM optimizations run
2025-09-29 18:32:31 -07:00
Michael Gottesman
ca2fb094d2 [sil-llvm-gen] Update some settings setup from sil-opt. 2025-09-29 12:58:18 -07:00
swift-ci
b2a0c63a95 Merge remote-tracking branch 'origin/main' into rebranch 2025-09-27 18:14:12 -07:00
Michael Gottesman
52a163fa5e Merge pull request #84555 from gottesmm/pr-4f37ab5228b75850c247af4f8dd913996a0390bd
[irgen] Make HasAArch64TBI an IRGen option instead of a LangOpts.
2025-09-27 18:09:12 -07:00
Michael Gottesman
361e63c815 [irgen] Make HasAArch64TBI an IRGen option instead of a LangOpts.
With some changes that I am making, we will no longer need this flag at the SIL
level, so we can just make it an IRGen flag (which it really should have been
in the first place).
2025-09-27 14:44:36 -05:00
Michael Gottesman
5c8a95f27a [sil-llvm-gen] Add support for emitting IR before LLVM optimizations run.
Specifically, I renamed the old llvm-as which printed with optimization as
llvm-as-opt and made llvm-as just test IRGen. That is really the true reason
that I created this utility many years ago: to test how IRGen lowers specific
SIL instruction sequences. How LLVM optimizes such sequences once lowered is a
different problem. I updated the one test that used sil-llvm-gen and required
optimizations to use llvm-as-opt so that the tests output did not change.
2025-09-27 14:42:04 -05:00
swift-ci
d5a03fa0e4 Merge remote-tracking branch 'origin/main' into rebranch 2025-09-26 22:36:42 -07:00
Erik Eckstein
a322fd9209 Serialization: remove the IS_OSSA flag from the module file header 2025-09-26 08:01:08 +02:00
Erik Eckstein
2f124cf564 Remove the -enable-ossa-modules option.
OSSA modules are enabled by default.
The compiler still accepts this option but it has no effect.
2025-09-26 08:01:08 +02:00
swift-ci
e35756ef85 Merge remote-tracking branch 'origin/main' into rebranch 2025-09-23 15:38:03 -07:00
Doug Gregor
0737723c5c Merge pull request #84465 from DougGregor/has-feature-library-evolution
Add an optional language feature for Library Evolution
2025-09-23 15:18:48 -07:00
Doug Gregor
c68ef1cf71 Add an optional language feature for Library Evolution
Replace the one-off compiler flag for Library Evolution with an
optional language feature. This makes the
`hasFeature(LibraryEvolution)` check work in an `#if`, and is
otherwise just cleanup.

Tracked by rdar://161125572.
2025-09-22 17:45:34 -07:00
swift-ci
2deb2f9a87 Merge remote-tracking branch 'origin/main' into rebranch 2025-09-19 22:17:53 -07:00
Kavon Farvardin
889baf7f2c Merge pull request #84411 from kavon/copyprop-onone
sil: provide ability to run CopyPropagation in -Onone
2025-09-19 22:09:59 -07:00
Kavon Farvardin
4a943d464d sil: provide ability to run CopyPropagation in -Onone
This does not enable it by default. Use either of the flags:

```
-enable-copy-propagation
-enable-copy-propagation=always
```

to enable it in -Onone. The previous frontend flag
`-enable-copy-propagation=true` has been renamed to
`-enable-copy-propagation=optimizing`, which is currently default.

rdar://107610971
2025-09-19 16:23:19 -07:00
swift-ci
3a31109821 Merge remote-tracking branch 'origin/main' into rebranch 2025-09-19 10:35:08 -07:00
Anthony Latsis
ea5d89d0d0 tools: Set Swift bug report message in some executable targets
If these programs crash, we want them to print the Swift bug report
message, not the default LLVM one, which leads to
https://github.com/llvm/llvm-project/issues.

While here, hoist the setting of the bug report message to the
START_PROGRAM macro so that we don't forget to set it in the future.
2025-09-19 12:05:31 +01:00
swift-ci
94f8b0d0e3 Merge remote-tracking branch 'origin/main' into rebranch 2025-08-25 17:03:36 -07:00
Michael Gottesman
bfecaa357f [frontend] Expose via a LangOption whether or not the compiler is compiling for a triple that supports AArch64 TBI.
Just breaking down layers of a larger patch to make it easier to review.
2025-08-21 12:52:49 -07:00
Anthony Latsis
3f841b515c Merge remote-tracking branch 'origin/main' into jepa-rebranch 2025-07-30 14:31:33 +01:00
Allan Shortlidge
e8ced33b81 swift-symbolgraph-extract: Infer target triple.
Infer the `-target` argument to `swift-synthesize-interface` to be the host
triple when unspecified instead of emitting an error.
2025-07-28 12:43:37 -07:00
Allan Shortlidge
3ffb218e9a swift-synthesize-interface: Infer target triple.
Infer the `-target` argument to `swift-synthesize-interface` to be the host
triple when unspecified instead of emitting an error.

Resolves rdar://156353450.
2025-07-28 12:42:57 -07:00
Anthony Latsis
b66a1aa8c5 DriverTool,IRGen: Address llvm::Target::createTargetMachine overload deprecation
See https://github.com/llvm/llvm-project/pull/130940.
2025-07-21 12:47:48 +01:00
swift-ci
f7bc202e92 Merge remote-tracking branch 'origin/main' into rebranch 2025-07-10 21:35:02 -07:00
Allan Shortlidge
c6dad96492 Make LayoutPrespecialization a baseline feature instead of experimental.
Since LayoutPrespecialization has been enabled by default in all compiler
invocations for quite some time, it doesn't make sense for it to be treated as
experimental feature. Make it a baseline feature and remove all the
checks for it from the compiler.
2025-07-10 11:25:28 -07:00
swift-ci
4668d6c04c Merge remote-tracking branch 'origin/main' into rebranch 2025-06-26 13:55:39 -07:00
Xi Ge
5c530ea4e4 ABI checker: drop usage of AllowDeserializingImplementationOnly
AllowDeserializingImplementationOnly was historically added as a defensive
check against deserailzation issues introduced by @implementationOnly imports.
It's no longer specified by other tools, thus the ABI checker should drop
it as well.

rdar://153683760
2025-06-25 12:15:21 -07:00
swift-ci
9a08a18af2 Merge remote-tracking branch 'origin/main' into rebranch 2025-06-20 15:45:44 -07:00
Anthony Latsis
1ceeb7089b Merge pull request #82338 from AnthonyLatsis/jepa
ASTBridging: Bridge more enums directly
2025-06-20 23:13:50 +01:00
swift-ci
1512b9775d Merge remote-tracking branch 'origin/main' into rebranch 2025-06-20 14:26:27 -07:00
Ian Anderson
cb954b98f9 [ABIChecker] Use -Isystem and -Fsystem for swift-api-digester
Use the Swift -Fsystem flag for swift-api-digester instead of the clang -iframework flag. Add support for -Isystem for parity.

rdar://152747420
2025-06-18 21:21:45 -07:00
Anthony Latsis
3e9923f0c0 ASTBridging: Bridge swift::AccessorKind directly 2025-06-19 04:26:52 +01:00
swift-ci
c99747e0c1 Merge remote-tracking branch 'origin/main' into rebranch 2025-06-02 23:38:09 -07:00
Artem Chikin
5b501ad2c5 Hard-code the 'Darwin' module as having been built without C++ interop
Textual interfaces for 'Darwin' built with recent compilers specify that it is built witout C++ interop enabled. However, to ensure compatibility with versions of the 'Darwin' module built with older compilers, we hard-code this fact. This is required to break the module cycle that occurs when building the 'Darwin' module with C++ interop enabled, where the underlying 'Darwin' clang module depends on C++ standard library for which the compiler brings in the 'CxxStdlib' Swift overlay, which depends on 'Darwin'.
2025-06-02 14:16:57 -07:00
swift-ci
1015e6583d Merge remote-tracking branch 'origin/main' into rebranch 2025-05-01 16:53:29 -07:00
Steven Wu
226552bf23 [Caching] Improve diagnostics around swift caching
Improve diagnostics message for swift caching build by trying to emit
the diagnostics early when there is more context to differentiate the
different kind of problems.

After the improvement, CAS Error should be more closer to when there is
functional problem with the CAS, rather than mixing in other kinds of
problem (like scanning dependency failures) when operating with a CAS.

rdar://145676736
2025-05-01 10:36:42 -07:00
swift-ci
fb8945fd36 Merge remote-tracking branch 'origin/main' into rebranch 2025-04-25 05:53:34 -07:00