transform: use IPSCCP pass instead of the constant propagation pass
The constant propagation pass is removed in LLVM 12, so this pass needs to be replaced anyway. The direct replacement would be the SCCP (sparse conditional constant propagation) pass, but perhaps a better replacement is the IPSCCP pass, which is an interprocedural version of the SCCP pass and propagates constants across function calls if possible. This is not always a code size reduction, but it appears to reduce code size in a majority of cases. It certainly reduces code size in almost all WebAssembly tests I did.
Этот коммит содержится в:
родитель
56cf69a66b
коммит
25dac32a88
1 изменённых файлов: 1 добавлений и 1 удалений
|
@ -56,7 +56,7 @@ func Optimize(mod llvm.Module, config *compileopts.Config, optLevel, sizeLevel i
|
|||
defer goPasses.Dispose()
|
||||
goPasses.AddGlobalDCEPass()
|
||||
goPasses.AddGlobalOptimizerPass()
|
||||
goPasses.AddConstantPropagationPass()
|
||||
goPasses.AddIPSCCPPass()
|
||||
goPasses.AddAggressiveDCEPass()
|
||||
goPasses.AddFunctionAttrsPass()
|
||||
goPasses.Run(mod)
|
||||
|
|
Загрузка…
Создание таблицы
Сослаться в новой задаче