On Thu, 30 Jul 2026 05:09:53 +0200
Anton Johansson <[email protected]> wrote:

> Run a standard LLVM -Oz optimization pass, which makes up the bulk of
> optimizations in helper-to-tcg.
> 
> Signed-off-by: Anton Johansson <[email protected]>
> ---
>  subprojects/helper-to-tcg/src/Pipeline.cpp | 12 ++++++++++++
>  1 file changed, 12 insertions(+)
> 
> diff --git a/subprojects/helper-to-tcg/src/Pipeline.cpp 
> b/subprojects/helper-to-tcg/src/Pipeline.cpp
> index a11c5fd353..571276de24 100644
> --- a/subprojects/helper-to-tcg/src/Pipeline.cpp
> +++ b/subprojects/helper-to-tcg/src/Pipeline.cpp
> @@ -202,5 +202,17 @@ int main(int argc, char **argv) {
>          MPM.addPass(createModuleToFunctionPassAdaptor(std::move(FPM)));
>      }
>  
> +    //
> +    // Run a -Oz optimization pass.  In general -Oz 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::Oz, compat::LTOPhase));
> +    MPM.addPass(
> +        PB.buildModuleOptimizationPipeline(compat::OptimizationLevel::Oz, 
> {}));
> +
>      return 0;
>  }
> -- 
> 2.52.0

Reviewed-by: Alessandro Di Federico <[email protected]>

-- 
Alessandro Di Federico
rev.ng Labs

Reply via email to