question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

remove the funroll-loops switch

See original GitHub issue

On OpenBSD/macppc, using the -funroll-loops option causes a segfault with scipy. Proposed patch below just removes the optimization flag across the board though. In the OpenBSD ports tree, this flag is sometimes removed due to buggy results.

For what it’s worth gentoo also recommends against it: http://wiki.gentoo.org/wiki/GCC_optimization#But_I_get_better_performance_with_-funroll-loops_-fomg-optimize.21

diff --git a/numpy/distutils/fcompiler/gnu.py b/numpy/distutils/fcompiler/gnu.py
index ccd5e8d..3b9481c 100644
--- a/numpy/distutils/fcompiler/gnu.py
+++ b/numpy/distutils/fcompiler/gnu.py
@@ -202,7 +202,6 @@ class GnuFCompiler(FCompiler):
             opt = ['-O2']
         else:
             opt = ['-O3']
-        opt.append('-funroll-loops')
         return opt

     def _c_arch_flags(self):

Issue Analytics

  • State:open
  • Created 9 years ago
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
charriscommented, Jan 14, 2015

I’ll let you argue this one with @juliantaylor 😉

Personally, I’ve found that judicious unrolling of loops can speed things up significantly, at least on older hardware. The keyword is probably ‘judicious’ 😉

0reactions
didickmancommented, Jan 15, 2019

will need to check. will come back here when i do. thanks.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Optimize Options - Using the GNU Compiler Collection (GCC)
Unroll loops whose number of iterations can be determined at compile time or upon entry to the loop. -funroll-loops implies -frerun-cse-after-loop . This...
Read more >
Remove Switch From Loop - Stack Overflow
Is there any way to remove the switch statement without compiling multiple variants of the for loop? Given that x86 has indirect branching, ......
Read more >
Loop unrolling - Wikipedia
... (February 2008) (Learn how and when to remove this template message). Loop unrolling, also known as loop unwinding, is a loop transformation...
Read more >
CPU2017 Result Flag Description - SPEC.org
For example -funroll-loops0 would disable unrolling of loops. -qopt-mem-layout-trans=4; [user] ... Linker toggle to specify qkmalloc linker library.
Read more >
CPP/C++ Compiler Flags and Options
-finline-functions; -m64; -funroll-loops; -fvectorize ... Disable C++ exceptions (it may be better for embedded systems or anything where ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found