Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion transform/optimizer.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ func Optimize(mod llvm.Module, config *compileopts.Config) []error {

// Run TinyGo-specific optimization passes.
OptimizeStringToBytes(mod)
OptimizeStringFromBytes(mod)
maxStackSize := config.MaxStackAlloc()
OptimizeAllocs(mod, nil, maxStackSize, nil)
err = LowerInterfaces(mod, config)
Expand All @@ -90,6 +91,8 @@ func Optimize(mod llvm.Module, config *compileopts.Config) []error {
// The go coverage tool expects this header before any blocks.
fmt.Fprintln(os.Stderr, "mode: set")
}
OptimizeStringToBytes(mod)
OptimizeStringFromBytes(mod)
OptimizeAllocs(mod, config.Options.PrintAllocs, maxStackSize,
func(pos token.Position, reason string) {
var line string
Expand All @@ -103,10 +106,11 @@ func Optimize(mod llvm.Module, config *compileopts.Config) []error {
}
},
)
OptimizeStringToBytes(mod)
OptimizeStringEqual(mod)

} else {
OptimizeStringFromBytes(mod)

// Must be run at any optimization level.
err := LowerInterfaces(mod, config)
if err != nil {
Expand Down
Loading
Loading