NilFoundation / zkLLVM

Zero-Knowledge Proof Systems Circuit Compiler
https://docs.nil.foundation/zkllvm
286 stars 48 forks source link

[Feature request]: Configure optimization level for circuit compilation #512

Open aleasims opened 8 months ago

aleasims commented 8 months ago

We have a CMake functions for circuit compilation configuration:

CircuitCompile.cmake

They set a number of required arguments for clang, required for proper compilation for assigner. However optimization level is hard-coded as -O1. This is done this way because we still don't fully support all the LLVM optimizations (e.g. with -O3 compilation may fail). However it would be nice to have the ability to configure this parameter from user side.

For example, we can modify CMAKE_CXX_FLAGS_* based on the CMake build type and define the optimization level this way.