Run a standard LLVM -Os optimization pass, which makes up the bulk of optimizations in helper-to-tcg.
Signed-off-by: Anton Johansson <a...@rev.ng> --- subprojects/helper-to-tcg/pipeline/Pipeline.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/subprojects/helper-to-tcg/pipeline/Pipeline.cpp b/subprojects/helper-to-tcg/pipeline/Pipeline.cpp index dde3641ab3..a26b7a7350 100644 --- a/subprojects/helper-to-tcg/pipeline/Pipeline.cpp +++ b/subprojects/helper-to-tcg/pipeline/Pipeline.cpp @@ -188,5 +188,17 @@ int main(int argc, char **argv) MPM.addPass(createModuleToFunctionPassAdaptor(std::move(FPM))); } + // + // Run a -Os optimization pass. In general -Os will prefer loop + // vectorization over unrolling, as compared to -O3. In TCG, this + // translates to more utilization of gvec and possibly smaller TBs. + // + + // Optimization passes + MPM.addPass(PB.buildModuleSimplificationPipeline( + compat::OptimizationLevel::Os, compat::LTOPhase)); + MPM.addPass( + PB.buildModuleOptimizationPipeline(compat::OptimizationLevel::Os)); + return 0; } -- 2.45.2