-
Notifications
You must be signed in to change notification settings - Fork 63
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PR #522 Compiler Optimization Issue #567
Comments
If this doesn't sort itself out before operationalization, then yes it is worth looking at--ATM we intend to use the Intel LLVM compilers in an operational setting. But if this is in fact an LLVM issue then it may "fix itself" before then. |
I just confirmed that clang from Homebrew llvm 16.0.6 with |
Huh, even with clang 15, compilation of |
Ugh, Homebrew for some weird reason has |
This issue is meant to track an ongoing issue in PR #522 regarding optimizations in GCC and Clang on boost::geometry SRS transformation objects. Clang/LLVM is being used primarily to debug this issue.
Current Behavior
When compiling
wkb.cpp
with-O0
, compilation is successful.However, when compiling with
-O1
or higher, compilation fails. Verbose output from clang shows that recursive calls tollvm::ScalarEvolution::getRangeRef
are causing a stack overflow.By increasing the process stack size (using
ulimit -s 15036
), we can successfully compile with-O1
and higher. This, however, doesn't alleviate the issue of the recursive calls during optimization.Bisect Checking
To figure out which optimization is causing the overflow, we use the LLVM option
-opt-bisect-limit=N
to find both the last successful compilation, and the first failed compilation. In my case, this was passes 97 and 98. Outputting the results of these passes and usingdiff
returned:This (I think) tells us the SROA Optimization is causing the error.
Behavior in GCC vs Clang
Currently, GCC does not segfault regardless of having a default stack size. However, compilation is very slow (upwards of 30+ minutes). I'm guessing that the same or similar optimization is causing the issue, since outputting and inspecting the optimization call graph shows optimizing hanging up at the
boost::geometry::srs::dpar::parameters
explicit constructor, which calls::add(value_proj)
in our case.System Information
I am using the following versions to debug this:
With Linux kernel:
6.4.2-arch1-1
The LLVM IR output for this issue is attached here: wkb.ll.tar.gz. I am running the following on it to verify optimization issues:
Potentially Related Issues
llvm/llvm-project#49579
boostorg/geometry#1006
The text was updated successfully, but these errors were encountered: