embench / embench-iot

The main Embench repository
https://www.embench.org/
GNU General Public License v3.0
248 stars 101 forks source link

Prevent LTO implosion #189

Open widlarizer opened 7 months ago

widlarizer commented 7 months ago

When clang is used with -flto, nbody and cubic would get absolutely optimized away. This was caused by pure (side-effect free) functions being run only once, even though they're called in a loop N times with the same parameters. For this reason, their parameters must have been changed to create N distinct sets of parameters. This PR adds small changes and reduces the cubic and nbody LTO scores by 2-4 factors of magnitude while bringing minor changes to non-LTO scores.