transform: run OptimizeMaps during package optimizations
This shrinks transform.Optimize() a little bit, working towards the goal of https://github.com/tinygo-org/tinygo/issues/2870. I ran the smoke tests and there is no practical downside: one test got smaller (??) and one had a different .hex hash, but other than that there was no difference. This should also make TinyGo a liiitle bit faster but it's probably not even measurable.
Этот коммит содержится в:
родитель
9246899b30
коммит
97842b367c
1 изменённых файлов: 5 добавлений и 1 удалений
|
@ -37,6 +37,11 @@ func OptimizePackage(mod llvm.Module, config *compileopts.Config) {
|
||||||
funcPasses.RunFunc(fn)
|
funcPasses.RunFunc(fn)
|
||||||
}
|
}
|
||||||
funcPasses.FinalizeFunc()
|
funcPasses.FinalizeFunc()
|
||||||
|
|
||||||
|
// Run TinyGo-specific optimization passes.
|
||||||
|
if optLevel > 0 {
|
||||||
|
OptimizeMaps(mod)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Optimize runs a number of optimization and transformation passes over the
|
// Optimize runs a number of optimization and transformation passes over the
|
||||||
|
@ -92,7 +97,6 @@ func Optimize(mod llvm.Module, config *compileopts.Config, optLevel, sizeLevel i
|
||||||
goPasses.Run(mod)
|
goPasses.Run(mod)
|
||||||
|
|
||||||
// Run TinyGo-specific optimization passes.
|
// Run TinyGo-specific optimization passes.
|
||||||
OptimizeMaps(mod)
|
|
||||||
OptimizeStringToBytes(mod)
|
OptimizeStringToBytes(mod)
|
||||||
OptimizeReflectImplements(mod)
|
OptimizeReflectImplements(mod)
|
||||||
OptimizeAllocs(mod, nil, nil)
|
OptimizeAllocs(mod, nil, nil)
|
||||||
|
|
Загрузка…
Создание таблицы
Сослаться в новой задаче