In a project I'm working on, there's a quadruple-nested for loop in a large file I'm trying to optimize I think would benefit from a compiler unroll with -funroll-all-loops. However, when I add this flag to the compiler, it unrolls the other loops the rest of the file and makes the overall program run more slowly. Is there a way (possibly via a #pragma) to apply compiler flags only to certain functions in the file instead of the entire file?
Thanks in advance.