similar to: [LLVMdev] Do the LLVM SJLJ intrinsics interact with C++ exception handling and execute C++ cleanup actions?

Displaying 20 results from an estimated 9000 matches similar to: "[LLVMdev] Do the LLVM SJLJ intrinsics interact with C++ exception handling and execute C++ cleanup actions?"

2013 May 08
1
[LLVMdev] Clarifying the state of setjmp/longjmp support in LLVM and Clang
I'm trying to make sense in the support for setjmp/longjmp in Clang and LLVM, with only partial success. I'll try to summarize my findings in the hope that someone can shed some light on why things are the way they are and what I'm missing. Clang. Clang recognizes two forms of setjmp (all I say here applies to longjmp similarly): * __builtin_setjmp: gets lowered to calling the
2016 Sep 16
2
setjmp/longjmp and volatile stores, but non-volatile loads
Hi, In our (non-C) compiler we use setjmp/longjmp to implement exception handling. For the initial implementation LLVM backend, I'm keeping that model. In order to ensure that changes performed in a try/setjmp==0 block survive the longjmp, the changes must be done via volatile operations. Given that volatility is a property of individual load/store instructions rather than of memory slots in
2015 Apr 28
2
[LLVMdev] MCJIT longjmp failure on Win64 - was Invalid or unaligned stack exception on Windows
On 28 April 2015 at 00:30, Reid Kleckner <rnk at google.com> wrote: > I think Paweł identified the problem. The frames on the stack between the > setjmp and longjmp must have valid unwind information, which is described > here: > https://msdn.microsoft.com/en-us/library/ft9x1kdx.aspx?f=255&MSPPError=-2147217396 > > In particular, it has this line about JITed code: >
2018 Dec 07
2
Should intrinsics llvm.eh.sjlj.setjmp be with isBarrier flag?
Hi, I meet an issue when I verify machineinstrs for Powerpc testcases in llvm. llc -mtriple=powerpc64-unknown-linux-gnu < llvm/llvm/test/CodeGen/PowerPC/sj-ctr-loop.ll -verify-machineinstrs Bad machine code: MBB exits via unconditional fall-through but ends with a barrier instruction! *** function: main basic block: %bb.2 for.body.lr.ph (0x100275437e8) Content in block BB.2:
2016 Dec 18
4
setjmp/longjmp and volatile stores, but non-volatile loads
On 30/09/16 20:10, Reid Kleckner wrote: > On Mon, Sep 19, 2016 at 4:42 AM, Jonas Maebe <jonas-devlists at watlock.be > <mailto:jonas-devlists at watlock.be>> wrote: > > So, can I use invoke and landingpad without using any of the other > exception handling intrinsics? (in combination with a dummy personality > function) Or will LLVM in all cases insist on
2016 Dec 19
0
setjmp/longjmp and volatile stores, but non-volatile loads
On Sun, Dec 18, 2016 at 02:23:01PM +0100, Jonas Maebe via llvm-dev wrote: > Recap: we use setjmp/longjmp for our exception handling on all platforms in > our regular (non-LLVM) code generators. I'd like to use the same > infrastructure with the LLVM code generator for code interoperability > purposes (the LLVM SjLj personality is not binary-compatible with our > existing
2015 Apr 12
2
[LLVMdev] Looking for advice on how to debug a problem with C++ style exception handling code that my compiler generates.
This is the only thing that I’ve found that works in terms of getting the exception to propagate out of the JITted function - change the “call” to an “invoke” and hook in the do-nothing landing-pad. https://gist.github.com/drmeister/7a35046f666826206973 Compare line 646 of the file above to the one that I just posted. > https://gist.github.com/drmeister/b97dec956c6ee9ffeb75 The first one
2011 Apr 27
3
[LLVMdev] built-in longjmp and setjmp
Okay. I understand builtin functions do not have to behave exactly the same way as standard library functions. What I wanted to know is what should the code generated by llvm (clang + llc) look like (I am working on the Mips back-end now). I guess there should be a behavior users expect to see who are using __builtin_setjmp/longjmp even they aren't the same as library functions. If the code
2015 Apr 12
2
[LLVMdev] Looking for advice on how to debug a problem with C++ style exception handling code that my compiler generates.
Logan, How would I dump the object file generated by the JIT compiler pipeline? Could you point me to an example of how something like that is done? I’m used to working with the JIT machinery in memory but not writing object files out to disk. I’m have code to generate object files for AOT compilation - is it done the same way? Best, .Chris. On Apr 12, 2015, at 2:27 PM, Logan Chien
2011 Apr 27
0
[LLVMdev] built-in longjmp and setjmp
The builtins are for internal compiler use in the context of SjLj exception handling. Any other use, including any direct calls of the builtins in user code, are a bad idea with no guaranteed behaviour. That they're exposed at all is, again, for historical purposes. Don't use them. -Jim On Apr 27, 2011, at 3:45 PM, Akira Hatanaka wrote: > Okay. I understand builtin functions do not
2011 Apr 27
0
[LLVMdev] built-in longjmp and setjmp
On Apr 27, 2011, at 4:08 PM, Joerg Sonnenberger wrote: > On Wed, Apr 27, 2011 at 03:55:53PM -0700, Jim Grosbach wrote: >> The builtins are for internal compiler use in the context of SjLj >> exception handling. Any other use, including any direct calls of the >> builtins in user code, are a bad idea with no guaranteed behaviour. >> That they're exposed at all is,
2013 Jul 12
2
[LLVMdev] setjmp/longjmp exception handling: how?
Dear list, I want to add SJLJ exception handling to my frontend. Unfortunately, there doesn't seem to be any examples in the documentation as to how to use the intrinsics @llvm.eh.sjlj.setjmp @llvm.eh.sjlj.longjmp @llvm.eh.sjlj.lsda @llvm.eh.sjlj.callsite Is there a way to force Clang to use SJLJ exception handling for C++? That way I would be able to look at its output to learn how to use
2014 Mar 08
2
[LLVMdev] Is LowerInvoke's "-enable-correct-eh-support" option unused?
On 6 March 2014 18:09, Mark Seaborn <mseaborn at chromium.org> wrote: > LowerAtomic "lowers atomic intrinsics to non-atomic form for use in a > known non-preemptible environment". LowerInvoke strips out exception > handling by converting invokes to calls, so that landingpads, resumes, etc. > become dead and can be removed by a later pass. > > (As an aside,
2016 Sep 30
0
setjmp/longjmp and volatile stores, but non-volatile loads
On Mon, Sep 19, 2016 at 4:42 AM, Jonas Maebe <jonas-devlists at watlock.be> wrote: > Reid Kleckner wrote: > > On Fri, Sep 16, 2016 at 10:13 AM, Jonas Maebe via llvm-dev > > <llvm-dev at lists.llvm.org <mailto:llvm-dev at lists.llvm.org>> wrote: > > > > model. In order to ensure that changes performed in a try/setjmp==0 > > block survive
2015 Apr 12
2
[LLVMdev] Looking for advice on how to debug a problem with C++ style exception handling code that my compiler generates.
Logan, I need to make a correction of the post that preceded this one! I was wrong when I said this: > When I load the bitcode file for this module and then dump it just before it is JITted, the “uwtable” attribute has disappeared - is this prune-eh doing its work even though it’s not listed above in the list of function pass managers? The “uwtable” attribute does not disappear! I had
2009 Feb 26
0
[LLVMdev] Question LowerSetJmp
Hi zhangzw, > In llvm src the file llvm/lib/Transforms/IPO/LowerSetJmp.cpp, it > seems for sjlj-eh ? it's not for sjlj-eh. The problem with setjmp/longjmp is that they can jump from one part of a function to any other part, which means that the control-flow graph is pointless; this makes everything more complicated. So how to deal with this? LLVM does have constructs that allow
2011 Apr 27
1
[LLVMdev] built-in longjmp and setjmp
Okay. Are you saying that you shouldn't use __builtin functions in general in your program or just __builtin_setjmp/longjmp? Also, are there any warnings issued by either clang or llvm if they are used in your program? On Wed, Apr 27, 2011 at 3:55 PM, Jim Grosbach <grosbach at apple.com> wrote: > The builtins are for internal compiler use in the context of SjLj exception >
2011 Apr 27
2
[LLVMdev] built-in longjmp and setjmp
On Wed, Apr 27, 2011 at 03:55:53PM -0700, Jim Grosbach wrote: > The builtins are for internal compiler use in the context of SjLj > exception handling. Any other use, including any direct calls of the > builtins in user code, are a bad idea with no guaranteed behaviour. > That they're exposed at all is, again, for historical purposes. Don't use them. Why is longjmp converted
2015 Apr 12
2
[LLVMdev] Looking for advice on how to debug a problem with C++ style exception handling code that my compiler generates.
Hi Christian, Thanks for your explanation. I know your situation now. I would suggest you to check the optimization pass used by the JIT compiler, especially IPO/PruneEH.cpp. It will try to add nounwind attribute to functions which will result in the problem you have mentioned earlier. Alternatively, as a workaround, try to add uwtable (function attribute) to the functions that are generated
2009 Feb 26
2
[LLVMdev] Question LowerSetJmp
On Feb 26, 2009, at 12:57 AM, Duncan Sands wrote: > So LLVM turns setjmp/longjmp > into a bunch of invokes and unwinds, in order to generate correct code > while not having to teach all the optimizers about setjmp/longjmp. > Setjmp/longjmp eh is something different. Or virtually identical. Bout the only difference is the number of registers saved and the order of those registers.