MCPcopy
hub / github.com/tinygo-org/tinygo / OptimizePackage

Function OptimizePackage

transform/optimizer.go:17–24  ·  view source on GitHub ↗

OptimizePackage runs optimization passes over the LLVM module for the given Go package.

(mod llvm.Module, config *compileopts.Config)

Source from the content-addressed store, hash-verified

15// OptimizePackage runs optimization passes over the LLVM module for the given
16// Go package.
17func OptimizePackage(mod llvm.Module, config *compileopts.Config) {
18 _, speedLevel, _ := config.OptLevel()
19
20 // Run TinyGo-specific optimization passes.
21 if speedLevel > 0 {
22 OptimizeMaps(mod)
23 }
24}
25
26// Optimize runs a number of optimization and transformation passes over the
27// given module. Some passes are specific to TinyGo, others are generic LLVM

Callers 1

BuildFunction · 0.92

Calls 2

OptimizeMapsFunction · 0.85
OptLevelMethod · 0.80

Tested by

no test coverage detected