aboutsummaryrefslogtreecommitdiffhomepage
path: root/transform/optimizer.go
diff options
context:
space:
mode:
authorDamian Gryski <[email protected]>2023-10-19 23:00:54 -0700
committerRon Evans <[email protected]>2024-01-31 17:51:55 +0100
commit2867da164dc6352ce1165d5a9e87103a4d8b74aa (patch)
tree52bb6639d31e7965ae0c0cb6c91b24f27288cc4d /transform/optimizer.go
parent7b8ae2d6b62bf2bc76b8529147d24137df6ff8ec (diff)
downloadtinygo-2867da164dc6352ce1165d5a9e87103a4d8b74aa.tar.gz
tinygo-2867da164dc6352ce1165d5a9e87103a4d8b74aa.zip
Allow larger systems to have a larger max stack alloc
Fixes #3331
Diffstat (limited to 'transform/optimizer.go')
-rw-r--r--transform/optimizer.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/transform/optimizer.go b/transform/optimizer.go
index 42acc2ddc..e73e97600 100644
--- a/transform/optimizer.go
+++ b/transform/optimizer.go
@@ -64,7 +64,8 @@ func Optimize(mod llvm.Module, config *compileopts.Config) []error {
// Run TinyGo-specific optimization passes.
OptimizeStringToBytes(mod)
OptimizeReflectImplements(mod)
- OptimizeAllocs(mod, nil, nil)
+ maxStackSize := config.MaxStackAlloc()
+ OptimizeAllocs(mod, nil, maxStackSize, nil)
err = LowerInterfaces(mod, config)
if err != nil {
return []error{err}
@@ -84,7 +85,7 @@ func Optimize(mod llvm.Module, config *compileopts.Config) []error {
}
// Run TinyGo-specific interprocedural optimizations.
- OptimizeAllocs(mod, config.Options.PrintAllocs, func(pos token.Position, msg string) {
+ OptimizeAllocs(mod, config.Options.PrintAllocs, maxStackSize, func(pos token.Position, msg string) {
fmt.Fprintln(os.Stderr, pos.String()+": "+msg)
})
OptimizeStringToBytes(mod)