Displaying 20 results from an estimated 5000 matches similar to: "seh / landing pads"
2016 Apr 04
2
How to call an (x86) cleanup/catchpad funclet
I've modified llvm to emit vc++ compatible SEH structures for my
personality on x86/Windows and my handler works fine, but the only thing
I can't figure out is how to call these funclets, they look like:
Catch:
"?catch$3@?0?m3 at 4HA":
LBB4_3: # %BasicBlock26
pushl %ebp
pushl %eax
addl $12, %ebp
movl %esp, -28(%ebp)
movl $LBB4_5, %eax
2015 May 15
8
[LLVMdev] RFC: New EH representation for MSVC compatibility
After a long tale of sorrow and woe, my colleagues and I stand here before
you defeated. The Itanium EH representation is not amenable to implementing
MSVC-compatible exceptions. We need a new representation that preserves
information about how try-catch blocks are nested.
WinEH background
-------------------------------
Skip this if you already know a lot about Windows exceptions. On Windows,
2012 Sep 17
2
[LLVMdev] Detail question about how to implement Win64 SEH
Hi!
I try to add more functionality to Win64 exception handling, based on
the posted patches from Charles Davis and João Matos.
But I have a question about how to map SEH handling to LLVM IR.
The basic structure of SEH in C is as follows:
__try {
// Do something.
}
__except (filter(GetExceptionCode(), GetExceptionInformation()))
{
// Handle exception
}
How to
2015 Dec 04
2
Support token type in struct for landingpad
> I dont have a concrete design right now and I am happy to take any other ideas
Three ideas come to mind, none of which are perfect:
1) I'm tempted to say that now that we have token type, landingpad should generally produce a token, the pointer should be extracted with the @llvm.eh.exceptionpointer intrinsic instead of an extractvalue, and the selector should likewise be extracted with
2020 Apr 01
2
[RFC] [Windows SEH] Local_Unwind (Jumping out of a _finally) and -EHa (Hardware Exception Handling)
Hi, all,
The intend of this thread is to complete the support for Windows SEH.
Currently there are two major missing features: Jumping out of a _finally and Hardware exception handling.
The document below is my proposed design and implementation to fully support SEH on LLVM.
I have completely implemented this design on a branch in repo:
2012 Sep 17
0
[LLVMdev] Detail question about how to implement Win64 SEH
Hi Kai,
> I try to add more functionality to Win64 exception handling, based on the posted
> patches from Charles Davis and João Matos.
>
> But I have a question about how to map SEH handling to LLVM IR.
are you sure you don't mean: map LLVM IR to SEH? I.e. are you talking about
how to implement LLVM's "dwarf" exception handling intrinsics and landingpad
2015 Dec 06
2
Support token type in struct for landingpad
It seems a little backwards to me to check the landingpad's type as the first check, since the personality dictates the landingpad's type. That said, yes I see how #4 is expedient in allowing personalities using the two main types to lump themselves into EHPersonality::Unknown.
As for supporting selector and exception pointer extraction for landingpad of token type, I think you'll
2014 Nov 10
2
[LLVMdev] RFC: How to represent SEH (__try / __except) in LLVM IR
Moving this month old RFC to llvmdev. Not sure why I sent this to cfe-dev
in the first place...
---
Based on code review discussion from John, he thinks filter expressions
should be emitted into the body of the function with the try, rather than
being outlined by the frontend.
Instead of having the frontend create filter functions, we would use labels
in place of typeinfo. The IR would look
2014 Nov 13
2
[LLVMdev] RFC: How to represent SEH (__try / __except) in LLVM IR
Thanks for the additional information.
Right now I’m experimenting with a mix of code compiled with MSVC and code compiled with clang, trying to get a C++ exception thrown and caught by the MSVC-compiled code across a function in the clang-compiled code. My goal here is to isolate a small part of what needs to be done in a way that lends itself to tinkering. I think this might lead me to the
2014 Nov 14
2
[LLVMdev] RFC: How to represent SEH (__try / __except) in LLVM IR
I don’t really have a good enough feeling for the landingpad syntax yet to comment on the most natural way to extend it yet, but creating a synthetic cleanup function to call from the personality function is what I was thinking.
With the current (trunk +/- a couple of weeks) clang, compiling for an “x86_64-pc-windows-msvc” target, I’m seeing a landingpad that looks like this:
lpad:
2019 Jun 25
3
Potential missed optimisation with SEH funclets
I’ve been experimenting with SEH handling in LLVM, and it seems like the unwind funclets generated by LLVM are much larger than those generated by Microsoft’s CL compiler.
I used the following code as a test:
void test() {
MyClass x;
externalFunction();
}
Compiling with CL, the unwind funclet that destroys ‘x’ is just two lines of asm:
lea rcx, QWORD PTR x$[rdx]
jmp ??1MyClass@@QEAA at XZ
2015 Dec 02
2
Support token type in struct for landingpad
> On Dec 1, 2015, at 11:14 PM, David Majnemer <david.majnemer at gmail.com> wrote:
>
> While we support 'opaque' types nested within struct types, they are not exactly battle tested:
>
> $ cat t.ll
> %opaque_ty = type opaque
>
> %struct_ty = type { i32, %opaque_ty }
>
> define %struct_ty @f(%struct_ty* %p) {
> %load = load %struct_ty,
2014 Nov 13
2
[LLVMdev] RFC: How to represent SEH (__try / __except) in LLVM IR
Hi Reid,
I’ve been following your proposal, and I’d be interested in helping out if I can. My main interest right now is in enabling C++ exception handling in clang for native (i.e. not mingw/cygwin) Windows targets (both 32-bit and 64-bit), but if I understand things correctly that will be closely related to your SEH work under the hood.
I’m still trying to get up to speed on what is and is
2018 May 22
2
LLVM SEH docs -- enregistration of locals in nonvolatile registers?
https://llvm.org/docs/ExceptionHandling.html#wineh
> No variables live in to or out of the funclet can be allocated in registers.
I don't think this is quite true. though it might be a useful simplification.
Obviously it is true for volatile registers, but I believe the funclet receives a CONTEXT
with the nonvolatiles restored. Obviously cumbersome to access, but it lets you enregister
2020 Jun 25
2
[RFC] Replacing inalloca with llvm.call.setup and preallocated
Bringing this back up for discussion on handling exceptions.
According to the inalloca design <https://llvm.org/docs/InAlloca.html>,
there should be a stackrestore after an invoke in both the non-exceptional
and exceptional case (that doesn't seem to be happening in some cases as
we've seen, but that's beside the point).
Does it make sense to model a preallocated call as
2015 May 19
2
[LLVMdev] RFC: New EH representation for MSVC compatibility
On Mon, May 18, 2015 at 8:40 PM, Joseph Tremoulet <jotrem at microsoft.com>
wrote:
> > I want to have separate normal and exceptional codepaths
>
> I assume you at least mean that's what you'll be doing in Clang's initial
> IR generation. Do you also mean to impose this as a restriction on other
> IR generators, and as a property that IR transformations must
2015 May 19
2
[LLVMdev] RFC: New EH representation for MSVC compatibility
I think adding transitions to cleanupblocks on the normal execution path
would be an optimization barrier. Most passes would see the cleanupblock
instruction and run the other way. It's definitely appealing from the
perspective of getting the smallest possible code, but I'm OK with having
no more than two copies of everything in the finally block.
I think with the addition of the
2015 May 18
2
[LLVMdev] RFC: New EH representation for MSVC compatibility
On Sat, May 16, 2015 at 7:29 AM, Steve Cheng <steve.ckp at gmail.com> wrote:
> On 2015-05-15 18:37:58 -0400, Reid Kleckner said:
>
> After a long tale of sorrow and woe, my colleagues and I stand here
>> before you defeated. The Itanium EH representation is not amenable to
>> implementing MSVC-compatible exceptions. We need a new representation that
>> preserves
2015 May 20
2
[LLVMdev] RFC: New EH representation for MSVC compatibility
This example is pretty compelling, but I still think I want to limit the
scope of this change to not include this feature. It's probably reasonable
to hold onto the idea as future work, though. In the meantime, frontends
can decide for themselves whether they want code size or stronger
optimization of cleanups by doing early outlining or not.
The only way we can hit the quadratic growth from
2018 May 24
0
LLVM SEH docs -- enregistration of locals in nonvolatile registers?
Is this example what you had in mind?
void f() {
int *p = get_p();
use_p(p);
try {
may_throw(p);
} catch (int) {
// don't need p
}
use_p(p);
}
The idea is that because p is not modified or used within the catch region
(the funclet), it can live in a callee-saved register across the whole
function.
That is true, it is possible, but I don't think it fits very well in