kfrlib / kfr

Fast, modern C++ DSP framework, FFT, Sample Rate Conversion, FIR/IIR/Biquad Filters (SSE, AVX, AVX-512, ARM NEON)
https://www.kfrlib.com
GNU General Public License v2.0
1.62k stars 248 forks source link

DFT build warnings: loop not unrolled #176

Closed michael-schollerer closed 1 year ago

michael-schollerer commented 1 year ago

Hi all, on evaluating performance on our Cortex-A53 Board I'm faced with a few of the following build warnings: In file included from kfr/include/kfr/dft/impl/dft-impl-f64.cpp:26: kfr/include/kfr/dft/impl/dft-impl.hpp:429:5: warning: loop not unrolled: the optimizer was unable to perform the requested transformation; the transformation might be disabled or specified as part of an unsupported transformation ordering [-Wpass-failed=transform-warning] DFT_STAGE_FN kfr/include/kfr/dft/impl/dft-fft.hpp:66:28: note: expanded from macro 'DFT_STAGE_FN' KFR_MEM_INTRINSIC void do_execute(cdirect_t, complex<T>* out, const complex<T>* in, u8* temp) final

Here is my configure build command: cmake -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="-mtune=native -mcpu=native" -Ofast ..

We are using clang11.

Can you help me why the loops cannot be unrolled? I have also played with compiler optimizations, but could not get rid of it.

Thanks a lot & best regards, Michael

dancazarin commented 1 year ago

Hi, Loop unrolling is not a critical optimisation here. Clang, depending on the target architecture, is or is not able to perform such optimisations but this has little impact on overall performance. The warning itself is muted in latest commit.