Commit Graph

59 Commits

Author SHA1 Message Date
Vedant Kumar
54a6be9d65 benchmark: Add SWIFT_BENCHMARK_UNOPTIMIZED_DRIVER option (#30794)
Add an option to allow compiling the benchmark test utilities and driver
at -Onone. This is needed because lldb does not support stepping through
optimized swift code.
2020-04-03 14:37:55 -07:00
Vedant Kumar
829f2588b3 benchmark: Build drivers with N_AST symtab entries (for debugging) (#30777)
On Darwin, we pass the *.swiftmodule paths transitively referenced by
the driver executable to ld64. ld64 inserts N_AST references to these
modules into the program, for later use by lldb.

This change should let us exercise much more lldb functionality via
`stepper` testing.
2020-04-02 16:12:05 -07:00
Kuba Mracek
45ba5cec05 [arm64e] Add arm64e support into Swift's build system 2020-02-27 16:08:15 -08:00
Vedant Kumar
609c84b600 benchmark: Make building with debug info the default (#29669) 2020-02-06 11:03:20 -08:00
Andrew Trick
b127216946 Benchmark cmake: Added SWIFT_BENCHMARK_USE_OS_LIBRARIES
Cleanup and document the configuration of the library path and rpath.

With SWIFT_BENCHMARK_USE_OS_LIBRARIES, it's now possible to directly
build benchmarks for a target device and run those benchmarks on the
device without building or installing Swift.

It's also possible now to specify an absolute SWIFT_LIBRARY_PATH to be
used as an rpath so installation can be skipped.
2019-04-10 09:31:02 -07:00
Michael Gottesman
f854547c55 [ownership] Enable ownership verification by default.
I also removed the -verify-sil-ownership flag in favor of a disable flag
-disable-sil-ownership-verifier. I used this on only two tests that still need
work to get them to pass with ownership, but whose problems are well understood,
small corner cases. I am going to fix them in follow on commits. I detail them
below:

1. SILOptimizer/definite_init_inout_super_init.swift. This is a test case where
DI is supposed to error. The only problem is that we crash before we error since
the code emitting by SILGen to trigger this error does not pass ownership
invariants. I have spoken with JoeG about this and he suggested that I fix this
earlier in the compiler. Since we do not run the ownership verifier without
asserts enabled, this should not affect compiler users. Given that it has
triggered DI errors previously I think it is safe to disable ownership here.

2. PrintAsObjC/extensions.swift. In this case, the signature generated by type
lowering for one of the thunks here uses an unsafe +0 return value instead of
doing an autorelease return. The ownership checker rightly flags this leak. This
is going to require either an AST level change or a change to TypeLowering. I
think it is safe to turn this off since it is such a corner case that it was
found by a test that has nothing to do with it.

rdar://43398898
2019-03-25 00:11:52 -07:00
Michael Gottesman
0dfaa19f9f [ownership] Rename enable-sil-ownership => verify-sil-ownership.
I have been meaning to do this change for a minute, but kept on putting it off.
This describes what is actually happening and is a better name for the option.
2019-03-18 01:31:44 -07:00
Michael Gottesman
7788567444 [benchmark] Compile the benchmark suite with ownership verification enabled. 2019-03-17 23:33:48 -07:00
Saleem Abdulrasool
d86ead48d4 build: specify vendor for Darwin benchmarks
The build was not specifying the vendor when building the Darwin
benchmarks.  Parts of the SDK rely on the vendor macro (`__APPLE__`) to
be defined which requires that the vendor is specified properly.  Ensure
that we do so.
2019-03-12 17:45:54 -07:00
eeckstein
cd920b69f4 Merge pull request #19910 from palimondo/fluctuation-of-the-pupil
[benchmark] More Robust Benchmark_Driver
2018-10-29 15:02:07 -07:00
Andrew Trick
599e5860c5 Remove references to SWIFT3 from benchmark Cmake files. 2018-10-11 21:53:19 -07:00
Pavol Vaskovic
0438c45e2d [benchmark] B_D iterations => independent-samples
Renamed Benchmark_Driver’s `iterations` argument to `independent-samples` to clarify its true meaning and  disambiguate it from the concept of `num-iters` used in Benchmark_O. The short form of the argument — `-i` — remains unchanged.
2018-10-11 18:56:27 +02:00
Graydon Hoare
94725dff2b [benchmark] Add preliminary helper for measuring instructions executed. 2018-08-25 01:29:37 -07:00
Erik Eckstein
13aae18d55 benchmarks: fix the cmake code to detect if SWIFT_EXEC supports the -align-module-to-page-size option.
This check should only be done for pre-built compilers.
2018-08-22 09:58:20 -07:00
Erik Eckstein
1a161c28ae benchmarks: compile with the new -align-module-to-page-size option, if supported by the compiler
To stabilize the benchmark results.
2018-07-27 17:15:14 -07:00
Michael Gottesman
36e0e6949c [benchmark] Add cmake support for compiling the benchmarks standalone on Linux.
To use this, one needs to first build an installable root for swift (i.e. like
the smoke testbot does). Then use the tool ./benchmark/scripts/build_linux.py
with the appropriate locations of the build-directory, installable snapshot,
and it will build the benchmarks. (There are more arguments, just use --help).

rdar://40541972
2018-05-29 14:25:16 -07:00
Michael Gottesman
9740bef838 [benchmark] Move build configuration/sdk configuration out of the main CMakeLists.txt file into AddSwiftBenchmarkSuite.cmake.
I am going to add some support here for Linux. I want to make sure that these
changes are hidden from the main CMakeLists.txt file since we want that file to
be as declarative as possible.

rdar://40541972
2018-05-28 18:39:43 -07:00
Michael Gottesman
09e1e20546 [benchmark][cmake] Move runcmd from AddSwiftBench* => SwiftBenchmarkUtils.cmake.
A quick NFC cleanup that I saw.

rdar://40541972
2018-05-24 18:15:33 -07:00
Andrew Trick
3715464c05 Add a cmake flag to the benchmarks: SWIFT_BENCHMARK_EXTRA_FLAGS.
We used to have this cmake flag but it seems to have disappeared. Building the
benchmarks with different swiftc flags is central to performance analysis, so
I'm not sure how people were getting this done.
2018-03-05 12:24:38 -08:00
Ben Cohen
3b4eacc3a8 Update benchmarks to Swift 4 (#14623) 2018-02-14 17:26:58 -08:00
Adam Nemet
80c9b044f6 Support opt-viewer when benchmarking in stand-alone mode
Tested locally with both stand-alone and in-tree benchmarking.
2017-12-13 21:19:22 -08:00
Adam Nemet
30cbf7e9e5 Support opt-viewer with multi-source benchmarks as well 2017-12-11 22:06:53 -08:00
Adam Nemet
7ed42f3963 Generate opt-view for benchmarks
When the SWIFT_BENCHMARK_GENERATE_OPT_VIEW cmake flag is on, the benchmarks are
compiled with -save-optimization-record which generate optimization remarks in
external YAML files. Then the opt-viewer tool from LLVM is invoked to generate
the HTML pages that displays the remarks embedded in the source code.

I've only added it to single-source benchmarks for now.

This can be enabled by
passing --extra-cmake-options='-DSWIFT_BENCHMARK_GENERATE_OPT_VIEW=ON' to
build-script.
2017-12-01 08:51:46 -08:00
Erik Eckstein
45a2ae48ce benchmarks: replace the Ounchecked build with an Osize build
We don't measure Ounchecked anymore. On the other hand we want to benchmark the Osize build.
2017-10-06 14:09:43 -07:00
Michael Gottesman
48f4a276ba [benchmark] Only add -external suffix to targets in standalone builds where SWIFT_BENCHMARK_SUBCMAKE_BUILD is set.
This enables us to distinguish in between builds which are triggered by a
subcmake call from the main swift cmake file and one from a user who is trying
to compile the swift benchmark suite against a misc swift installation/use the
ninja file by hand.
2017-10-01 10:41:48 -07:00
Michael Gottesman
a36c649429 [benchmark] We need the module_name in swift_benchmark_compile_archopts to look up sources.
This solves problems relating to the SOURCES variable not finding anything
files. module_name expanded to nothing so:

  ${${module_name}_sources} -> ${_sources} -> ''

Now we handle this properly.

rdar://34556274
2017-09-25 19:27:56 -07:00
Michael Gottesman
5dfbec05c4 [benchmark] Allow for swift3 and swift4 multi source benchmarks
rdar://34556274
2017-09-25 15:26:43 -07:00
Michael Gottesman
1b960d58b7 [benchmark] Extract multisource benchmark cmake code into helper functions.
This is the next step in allowing (at least the multi-source benchmarks) to
compile swift 4 and swift 3 in a nice way.

rdar://34556274
2017-09-25 14:16:39 -07:00
Michael Gottesman
c2d8cc7ff0 [benchmark] Add support for building out of tree via build-script against the just built swift.
I recently broke the out of tree build by mistake [its fixed now ; )]. This
inspired me to make it easy to test this behavior by adding support to
build-script/cmake/etc for running an external benchmark build via
AddExternalProjects.

Now I can just call build-script with --build-external-benchmarks and thats it!
It should just work! It already helped me to avoid breaking the external build
twice!

I hope that eventually we get this on a bot to make sure it keeps working [or
even added to the smoke tests ; )].

*NOTE* This is disabled by default so it will not affect normal builds.

*NOTE* This just builds the external benchmarks. There is an rpath issue that
prevents you from running them (the benchmarks have the rpath set as if they are
next to the stdlib, but they are not. This can be fixed in a few different ways,
but I do not have time to finish implementing it = (. But this commit is a good
first step and at least detects build errors.
2017-09-25 12:31:39 -07:00
Michael Gottesman
574b05d252 Merge pull request #12092 from gottesmm/recommit_benchmark_changes_with_precondition
Recommit benchmark changes with precondition
2017-09-25 10:46:15 -07:00
Michael Gottesman
84f5446a78 Revert "Reverting benchmark cmake changes. They break out-of-tree benchmark builds, which is used by some bots"
This reverts commit db21063afa.
2017-09-24 23:19:25 -07:00
Michael Gottesman
d04f97a3f0 [benchmark][cmake] Provide our own precondition impl.
This ensures that we have a precondition implementation both when building in
tree and out of tree.
2017-09-24 23:19:25 -07:00
Michael Gottesman
83ae78727d [benchmark][cmake] Implement IS_SWIFT_BUILD correctly and rename it to SWIFT_BENCHMARK_BUILT_STANDALONE. 2017-09-24 22:53:50 -07:00
Andrew Trick
cc1165fc43 Benchmark cmake: DriverUtils will depend on TestsUtils. 2017-09-22 12:49:59 -07:00
Andrew Trick
e53451a98b cmake: Benchmarks need to build as a separate project (out-of-tree). 2017-09-22 12:49:59 -07:00
Erik Eckstein
db21063afa Reverting benchmark cmake changes. They break out-of-tree benchmark builds, which is used by some bots
Revert "Refactor out the creation of the benchmark libraries into a helper routine swift_benchmark_library. Initially just use it for DriverUtils."

This reverts commit ac539730e4. (+3 squashed commits)
Squashed commits:
[755f057] Revert "[benchmark][cmake] Refactor the swift benchmark helper libraries to use swift_benchmark_library."

This reverts commit a82945e033.
[58e09c6] Revert "[benchmark][cmake] "swift_benchmark_library" => "add_swift_benchmark_library"."

This reverts commit 0e4b7b69cd.
[5f5f2c1] Revert "[benchmark][cmake] Fix typo. This is NFC since this option is usually disabled."

This reverts commit 30f4b1b3e5.
2017-09-21 17:34:04 -07:00
Michael Gottesman
30f4b1b3e5 [benchmark][cmake] Fix typo. This is NFC since this option is usually disabled. 2017-09-20 17:25:47 -07:00
Michael Gottesman
0e4b7b69cd [benchmark][cmake] "swift_benchmark_library" => "add_swift_benchmark_library".
This matches the names used in the rest of our cmake.

rdar://34556274
2017-09-20 17:25:47 -07:00
Michael Gottesman
a82945e033 [benchmark][cmake] Refactor the swift benchmark helper libraries to use swift_benchmark_library.
rdar://34556274
2017-09-20 17:25:42 -07:00
Michael Gottesman
ac539730e4 Refactor out the creation of the benchmark libraries into a helper routine swift_benchmark_library. Initially just use it for DriverUtils.
This will allow for per-benchmark flags to be added.

rdar://34556274
2017-09-20 16:36:48 -07:00
Dave Abrahams
7f9380d098 Remove bogus options from benchmark build
This option is misleading, and never should have been there in the first place.  Fortunately it was having no effect because the standard library is already compiled to SIL and the internal checks have been eliminated from any benchmark build.
2017-05-30 11:18:41 -07:00
Ted Kremenek
3fb6e71411 Force the benchmark suite to build with -swift-version 3.
Some of the benchmarks use Swift 3 APIs.  Let’s keep them building that
way to not perturb benchmark numbers.

We should consider adding benchmarks that specifically enable -swift-version 4.
2017-04-21 17:25:45 -07:00
Doug Coleman
e7390d1770 Revert "utils: Add swiftenvs, which allow the overriding of compiler tools."
This reverts commit 2b923f3846.
2017-03-22 20:09:34 -07:00
Doug Coleman
9880f65767 Revert "cmake: Ensure that CMAKE_CODESIGN is set instead of trying to run empty"
This reverts commit f3b7485369.
2017-03-22 20:09:34 -07:00
Doug Coleman
f3b7485369 cmake: Ensure that CMAKE_CODESIGN is set instead of trying to run empty
commands.
2017-03-21 21:13:12 -07:00
Doug Coleman
2b923f3846 utils: Add swiftenvs, which allow the overriding of compiler tools. 2017-03-21 14:59:12 -07:00
Erik Eckstein
bafeb39bdb cmake: make benchmarks compilable without -wmo
This only affects benchmark builds for which -whole-module-optimization is removed from BENCHOPTS in benchmark/CMakeLists.txt
2016-10-20 14:27:00 -07:00
Michael Gottesman
6fd9dca2e6 [benchmark] Allow the number of test samples cmake will use to be specified from the command line.
The benchmark bot uses this functionality today to run the benchmarks. By
default build-script only uses 3 samples for each test. Given the noise on our
systems, this is definitely not sufficient for any sort of robust numbers.

Using this patch, I am going to change the benchmarking bot to take the minimum
of 20 samples as we do for our internal benchmarking. This should help make the
benchmark bot give better data. This will have as a cost cause the bot to take
more time. The testing time issue can be solved down the line by changing to a
protocol where we first do tests with a small number of samples (< 5). Then any
benchmark with a delta > 5% is rerun with 20 samples or perhaps until a
statistical criterion is satisfied. But until that is implemented, this at least
makes the bot useful.

There are other things that need to be changed on the benchmarking bot as well,
namely that it should build on a separate machine from which it is running the
benchmarks on. The benchmarking machine should be quiet and not have any work
being done on it. But that is also for another time.
2016-09-23 20:05:10 -07:00
Luke Larson
c60add3668 Stop ad-hoc signing stdlib dylibs for benchmarks
rdar://problem/27619856
2016-08-03 14:11:11 -07:00
Dmitri Gribenko
4329ebefd8 CMake: remove an unused variable 2016-05-30 19:34:29 -07:00