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
Compile VMCore with -fno-exceptions #1169
Comments
I'd like to take this farther: can we eliminate exceptions from all of LLVM? The single place where they are the most useful is in libsystem, but we've already found that we don't -Chris |
Certain libraries (Analysis, etc.) already don't throw exceptions. We could turn
We have? Could you give me an example? All the tools have exception handlers in |
Sounds good. I don't remember the specifics, but coverity uncovered a number of them, which I fixed back then. |
What's the status of this? Are we trying to remove exceptions from all of LLVM |
Not going to happen for 1.8. Hopefully for 1.9, we're pretty close already. -Chris |
I just built LLVM with -fno-exceptions turned on in LLVMCore. Everything built |
Right. I don't see any value in trying to push to get a half-baked solution for 1.8. We might as well do it -Chris |
The grep tool tells me that these libraries: ./lib/AsmParser/Makefile Are the only ones that remain with "REQUIRES_EH". Does anyone know if |
nice work on asmparser. I think that once libsystem/support/bytecode are converted over, we would be |
Reminder: This patch: |
With numerous recent patches (too many to list here), we are now exception free .. getting closer. |
A note: the only tool that uses libdebugger is llvm-db. Once the .bc handling stuff is EH free, almost all of -Chris |
Yes, that's what I was planning to do .. leave REQUIRES_EH turned on in Unfortunately, getting the exceptions out of the Archive/Bytecode stuff is Mine. |
Fixed. LLVM now builds with -fno-exceptions except in lib/Debug and the tools. This leads to the following reduction in library and executable sizes for Debug Improvement: 19,000K (2.59%) |
Extended Description
We might be able to reduce the size of libVMCore.a by compiling it with the
-fno-exceptions flag. This prevents the compiler from generating functions that
know how to propagate exceptions. VMCore is very close to being exception
handling free. With a little work, we could make it exception free and turn
this flag on permanently in the lib/VMCore/Makefile.
Here are the outstanding issues:
Pass.cpp in the constructor of FunctionPass needs to handle exceptions coming
from the bytecode reader when its function is materialized. Possible solutions:
implies that any ModuleProvider would not be able to throw exceptions.
materialization.
Verifier.cpp throws an exception when it checks abortIfBroken(). This is a
feature used by the bcanalyzer and llvm-as. Both programs could be made to just
abort if the verifier fails.
The libraries VMCore depends upon (Support, bzip2, System) do not throw in
anything that VMCore includes or calls.
Since VMCore has a lot of functions, this could be a big win for library size.
The text was updated successfully, but these errors were encountered: