
ThinLTO optimizes across LLVM modules at link time. This means that optimizations (such as inlining and const-propagation) are possible between C and Go. This makes this change especially useful for CGo, but not just for CGo. By doing some optimizations at link time, the linker can discard some unused functions and this leads to a size reduction on average. It does increase code size in some cases, but that's true for most optimizations. I've excluded a number of targets for now (wasm, avr, xtensa, windows, macos). They can probably be supported with some more work, but that should be done in separate PRs. Overall, this change results in an average 3.24% size reduction over all the tinygo.org/x/drivers smoke tests. TODO: this commit runs part of the pass pipeline twice. We should set the PrepareForThinLTO flag in the PassManagerBuilder for even further reduced code size (0.7%) and improved compilation speed.
19 строки
695 Б
Modula-2
19 строки
695 Б
Modula-2
module github.com/tinygo-org/tinygo
|
|
|
|
go 1.15
|
|
|
|
require (
|
|
github.com/aykevl/go-wasm v0.0.2-0.20211119014117-0761b1ddcd1a
|
|
github.com/blakesmith/ar v0.0.0-20150311145944-8bd4349a67f2
|
|
github.com/chromedp/cdproto v0.0.0-20220113222801-0725d94bb6ee
|
|
github.com/chromedp/chromedp v0.7.6
|
|
github.com/gofrs/flock v0.8.1
|
|
github.com/google/shlex v0.0.0-20181106134648-c34317bd91bf
|
|
github.com/marcinbor85/gohex v0.0.0-20200531091804-343a4b548892
|
|
github.com/mattn/go-colorable v0.1.8
|
|
go.bug.st/serial v1.1.3
|
|
golang.org/x/sys v0.0.0-20220114195835-da31bd327af9
|
|
golang.org/x/tools v0.1.6-0.20210813165731-45389f592fe9
|
|
gopkg.in/yaml.v2 v2.4.0
|
|
tinygo.org/x/go-llvm v0.0.0-20220211075103-ee4aad45c3a1
|
|
)
|