Commit Graph

8 Commits

Author SHA1 Message Date
Xi Ge
e004a803ca test: recover Driver/opt-record.swift
rdar://71898247
2020-12-02 09:54:24 -08:00
Xi Ge
84afba5cf0 driver: forward driver invocation to the new driver by default
rdar://71817843
2020-12-01 15:20:22 -08:00
Francis Visoiu Mistrih
e724ebab6b [Remarks] Add a specialized RemarkStreamer for SIL remarks
This allows the usage of the whole remark infrastructure developed in
LLVM, which includes a new binary format, metadata in object files, etc.

This gets rid of the YAMLTraits-based remark serialization and does the
plumbing for hooking to LLVM's main remark streamer.

For more about the idea behind LLVM's main remark streamer, see the
docs/Remarks.rst changes in https://reviews.llvm.org/D73676.

The flags are now:

* -save-optimization-record: enable remarks, defaults to YAML
* -save-optimization-record=<format>: enable remarks, use <format> for
serialization
* -save-optimization-record-passes <regex>: only serialize passes that
match <regex>.

The YAMLTraits in swift had a different `flow` setting for the debug
location, resulting in some test changes.
2020-03-02 18:33:20 -08:00
Jordan Rose
b9af6e0110 [SIL] Honor #sourceLocation in optimization record YAML files
Previously, we were using the physical buffer name but the virtual
line number, which is bogus.
2018-08-29 11:46:41 -07:00
Adam Nemet
004c7d2748 Include module in demangled name in opt remarks
This allows filtering noisy generic specialization and inlining remarks for
stdlib functions based on the module name.
2017-12-05 22:49:13 -08:00
Adam Nemet
1520cbe6dd Prefix opt-remark ID with sil "namespace"
This is so that we can unambiguously distinguish from LLVM opt remarks.
2017-12-05 20:42:53 -08:00
Adam Nemet
65b24eb9d5 Demangle function names in remarks 2017-11-07 22:04:26 -08:00
Adam Nemet
66085a8aef Save optimization remarks in an external YAML file
This brings the capability from clang to save remarks in an external YAML files.
YAML files can be viewed with tools like the opt-viewer.

Saving the remarks is activated with the new option -save-optimization-record.

Similarly to -emit-tbd, I've only added support for single-compile mode for now.
In this case the default filename is determined by
getOutputFilenameFromPathArgOrAsTopLevel, i.e. unless explicitly specified
with -save-optimization-record-path, the file is placed in the directory of the
main output file as <modulename>.opt.yaml.
2017-10-27 10:14:27 -07:00