Commit Graph

12 Commits

Author SHA1 Message Date
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
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
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
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
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
Ian Anderson
cdb42c3535 [ClangImporter] clang's -iframework comes before builtin usr/local/include, but Swift's -Fsystem comes after
When Swift passes search paths to clang, it does so directly into the HeaderSearch. That means that those paths get ordered inconsistently compared to the equivalent clang flag, and causes inconsistencies when building clang modules with clang and with Swift. Instead of touching the HeaderSearch directly, pass Swift search paths as driver flags, just do them after the -Xcc ones.

Swift doesn't have a way to pass a search path to clang as -isystem, only as -I which usually isn't the right flag. Add an -Isystem Swift flag so that those paths can be passed to clang as -isystem.

rdar://93951328
2024-12-23 22:15:52 -08:00
Tim Kientzle
1d961ba22d Add #include "swift/Basic/Assertions.h" to a lot of source files
Although I don't plan to bring over new assertions wholesale
into the current qualification branch, it's entirely possible
that various minor changes in main will use the new assertions;
having this basic support in the release branch will simplify that.
(This is why I'm adding the includes as a separate pass from
rewriting the individual assertions)
2024-06-05 19:37:30 -07:00
Slava Pestov
06b1aee360 Evaluator: Cache circular evaluation to avoid redundant diagnostics
Previously, if a request R evaluated itself N times, we would emit N
"circular reference" diagnostics. These add no value, so instead let's
cache the user-provided default value on the first circular evaluation.

This changes things slightly so that instead of returning an
llvm::Expected<Request::OutputType>, various evaluator methods take
a callback which can produce the default value.

The existing evaluateOrDefault() interface is unchanged, and a new
evaluateOrFatal() entry point replaces
llvm::cantFail(ctx.evaluator(...)).

Direct callers of the evaluator's operator() were updated to pass in
the callback. The benefit of the callback over evaluateOrDefault() is
that if the default value is expensive to constuct, like a dummy
generic signature, we will only construct it in the case where a
cycle actually happened, otherwise we just delete the callback.

(cherry picked from commit b8fcf1c709efa6cd28e1217bd0efe876f7c0d2b7)
2024-02-09 16:02:24 -08:00
Erik Eckstein
e3a174b85e Replace the sil-llvm-gen binary with a symlink to swift-frontend
rdar://76551283
2023-04-24 13:48:23 +02:00