To build benchmarks that use C++ `std::span`, we need to use C++20 standard.
SwiftPM supports `.interoperabilityMode(.Cxx)` build setting starting from version 5.9. In more recent versions, SwiftPM is also able to correctly propagate the C++ standard version (e.g. `-Xcc -std=c++20`) to the Swift compiler invocation, when C++ interop is enabled. The C++ standard version is only propagated if the modern build setting is used. This has caused Linux CI failures in the past.
This change switches the package manifest to use the modern build setting to enable C++ interop.
When the benchmarks are built with SwiftPM, the -std=c++20 flag is passed if the -cxx-interoperability-mode is present. This patch switches from -Xfrontend -enable-experimental-cxx-interop to the required interoperability flag.
* [SILOptimizer] Add prespecialization for arbitray reference types
* Fix benchmark Package.swift
* Move SimpleArray to utils
* Fix multiple indirect result case
* Remove leftover code from previous attempt
* Fix test after rebase
* Move code to compute type replacements to SpecializedFunction
* Fix ownership when OSSA is enabled
* Fixes after rebase
* Changes after rebasing
* Add feature flag for layout pre-specialization
* Fix pre_specialize-macos.swift
* Add compiler flag to benchmark build
* Fix benchmark SwiftPM flags
This is just a useful thing if one wants to have a separate folder of down
stream benchmarks. The code is written like this to hopefully prevent merge
conflicts from happening.
This does a few things:
1. We were not updated for libProc's addition. I bumped the swiftpm version
number to get the systemLibrary functionality (thanks Ankit).
2. I split up a bunch of lines to help the typechecker out a little bit.
This means that we can now edit benchmarks in Xcode! Keep in mind:
1. This is not an official build. It is just so we can use Xcode to edit files
and get IDE features.
2. I had to do a little hackery to keep the build the way it is today where all
single-source files are their own modules.
3. As long as we do not change the directory structure, everything should just
update and work since I added a little code that dynamically adds the tests.
Also, to do this I had to rename multi-source/PrimsSplit/main.swift =>
Prims_main.swift. That is because the name main.swift is special in some way and
I hit linker errors. By simply changing the name from main.swift =>
Prims_main.swift, everything is good. I am going to file a separate bug for
that.