mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-03 10:37:46 +00:00
compiler: add globaldce pass to start of optimization pipeline
This reduces code size in a few cases when tested against the drivers smoketests (although there was one minor increase) without significantly increasing compile time. In fact, in my testing compile time appears to be going down a little bit (around 1%, within the noise).
This commit is contained in:
committed by
Ron Evans
parent
0933577e60
commit
d1cc3c109d
@@ -45,6 +45,7 @@ func (c *Compiler) Optimize(optLevel, sizeLevel int, inlinerThreshold uint) []er
|
||||
// Run some preparatory passes for the Go optimizer.
|
||||
goPasses := llvm.NewPassManager()
|
||||
defer goPasses.Dispose()
|
||||
goPasses.AddGlobalDCEPass()
|
||||
goPasses.AddGlobalOptimizerPass()
|
||||
goPasses.AddConstantPropagationPass()
|
||||
goPasses.AddAggressiveDCEPass()
|
||||
|
||||
Reference in New Issue
Block a user