diff options
author | Ayke van Laethem <[email protected]> | 2022-11-25 02:27:27 +0100 |
---|---|---|
committer | Ayke <[email protected]> | 2023-01-25 18:43:00 +0100 |
commit | da362b8a24fe271bd03a98d44305c47bcfefe05b (patch) | |
tree | 6d2764fca6a50b22ac3811e2487a74aab7cb74a3 /compileopts/config.go | |
parent | 7fa13ed0a663f4358144fa211369d03aae06b7a2 (diff) | |
download | tinygo-da362b8a24fe271bd03a98d44305c47bcfefe05b.tar.gz tinygo-da362b8a24fe271bd03a98d44305c47bcfefe05b.zip |
wasm: support ThinLTO
Using ThinLTO manages to optimize binaries quite significantly. The
exact amount varies a lot by program but it's about 10-15% usually.
Don't remove non-ThinLTO support yet. It would not surprise me if this
triggered some unintended side effect. Eventually, non-ThinLTO support
should be removed though.
Diffstat (limited to 'compileopts/config.go')
-rw-r--r-- | compileopts/config.go | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/compileopts/config.go b/compileopts/config.go index b22db15dc..499dcd27a 100644 --- a/compileopts/config.go +++ b/compileopts/config.go @@ -190,17 +190,11 @@ func (c *Config) StackSize() uint64 { return c.Target.DefaultStackSize } -// UseThinLTO returns whether ThinLTO should be used for the given target. Some -// targets (such as wasm) are not yet supported. -// We should try and remove as many exceptions as possible in the future, so -// that this optimization can be applied in more places. +// UseThinLTO returns whether ThinLTO should be used for the given target. func (c *Config) UseThinLTO() bool { - parts := strings.Split(c.Triple(), "-") - if parts[0] == "wasm32" { - // wasm-ld doesn't seem to support ThinLTO yet. - return false - } - // Other architectures support ThinLTO. + // All architectures support ThinLTO now. However, this code is kept for the + // time being in case there are regressions. The non-ThinLTO code support + // should be removed when it is proven to work reliably. return true } |