aboutsummaryrefslogtreecommitdiffhomepage
path: root/go.mod
diff options
context:
space:
mode:
authorAyke van Laethem <[email protected]>2022-02-07 15:19:25 +0100
committerRon Evans <[email protected]>2022-03-12 12:55:38 +0100
commit603fff78d496445ab3d614c45c75894a9f94999e (patch)
treed981e4616bb52bb29e7a29cbd53cfb16bcfb432a /go.mod
parentd4b1467e4c7f1c9e89a8b9efb89a25e9cd6067b2 (diff)
downloadtinygo-603fff78d496445ab3d614c45c75894a9f94999e.tar.gz
tinygo-603fff78d496445ab3d614c45c75894a9f94999e.zip
all: add support for ThinLTO
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.
Diffstat (limited to 'go.mod')
-rw-r--r--go.mod2
1 files changed, 1 insertions, 1 deletions
diff --git a/go.mod b/go.mod
index b1ea3479c..3e9612c9c 100644
--- a/go.mod
+++ b/go.mod
@@ -15,5 +15,5 @@ require (
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-20220121152956-4fa2ab2718f3
+ tinygo.org/x/go-llvm v0.0.0-20220211075103-ee4aad45c3a1
)