Displaying 20 results from an estimated 3000 matches similar to: "[LLVMdev] Exception filter IR model"
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 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:
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
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
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
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
2014 May 23
2
[LLVMdev] Personality function for llvm.gcroot
Hello,
Why does LLVM use __gcc_personality_v0 instead of __gxx_personality_v0
function when it lowers llvm.gcroot intrinsic? For my try-catch codegen I
use last one (so does clang) and it conflicts with __gcc_personality_v0
produced by LLVM? I know how to solve it with my own GC plug-in, just
wondering.
And what's the difference between these two functions anyway?
Thanks,
2020 May 03
2
[RFC] [Windows SEH] Local_Unwind (Jumping out of a _finally)
Hi,
Per Reid’s feedback, I have separated two SEH missing features.
This thread now is only focusing on _local_unwind(), Jumping out of _finally.
The design is documented in Wiki here: https://github.com/tentzen/llvm-project/wiki/Windows-SEH:-Local_Unwind-(aka:-Jumping-Out-of-_Finally)
The implementation can be seen here:
2020 Apr 16
2
[RFC] [Windows SEH][-EHa] Support Hardware Exception Handling
Hi, Eli,
Why are you under the impression that threw_exception() will not be called if optimizations are enabled? I don’t know if the -EHa Spec is clearly described in MSFT Webs. At least this proposal has described the rules for both C & C++ code.
The very first rule clearly said that “no exception can move in or out of _try region., i.e., no potential faulty instruction can be moved
2015 Feb 11
2
[LLVMdev] RFC: Native Windows C++ exception handling
These are exactly the sorts of code transformations we want to allow by
delaying the outlining until later. By keeping such code inlined in the
parent function until after optimization, we enable a lot of core
optimizations like SROA. For example, we should be able to completely
eliminate wrappers like unique_ptr that would otherwise stay around due to
the pointer escaped to the destructor call
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
2020 Apr 15
2
[RFC] [Windows SEH][-EHa] Support Hardware Exception Handling
Hi,
This is a spin-off of previous Windows SEH RFC below. This RFC only focus on supporting HW Exception Handling.
A detailed implementation can be seen in here: https://github.com/tentzen/llvm-project/commit/8a2421c274b683051e456cbe12c177e3b934fb5e
It passes all MSVC SEH suite (excluding those with “Jumping out of _finally” ( _Local_Unwind)).
Thanks,
--Ten
**** The rules for C code: ****
2014 Nov 24
1
[LLVMdev] RFC: How to represent SEH (__try / __except) in LLVM IR
Hi Reid,
I've been working on the outlining code and have a prototype that produces what I want for a simple case.
Now I'm thinking about the heuristics for recognizing the various logical pieces for C++ exception handling code and removing them once they’ve been cloned. I've been working from various comments you've made earlier in this thread, and I'd like to run something
2020 Apr 16
2
[RFC] [Windows SEH][-EHa] Support Hardware Exception Handling
As stated in the design paragraph, this design does not intend to model precise CFG at instruction level since it’s complicated and unnecessary.
As long as we comply C and C++ rules listed below, we achieve -EHa semantic. There is NO need to precisely model HW exception control flow at instruction-level.
Your example about memcpy() is just a bug in current implementation. I will fix it so that
2015 Feb 13
2
[LLVMdev] C++ exception handling
(Moving this discussion on list as this could be of general interest.)
My current work-in-progress implementation is attempting to map out the blocks used by a landing pad before it starts outlining. It creates a table of catch and cleanup handlers with the block at which each one starts. During outlining I intend to have another mechanism to check to see if we’ve already outlined the handler
2014 Nov 18
2
[LLVMdev] RFC: How to represent SEH (__try / __except) in LLVM IR
> On Nov 18, 2014, at 11:07 AM, Reid Kleckner <rnk at google.com> wrote:
>
> On Tue, Nov 18, 2014 at 10:50 AM, Bob Wilson <bob.wilson at apple.com <mailto:bob.wilson at apple.com>> wrote:
>
>> On Nov 17, 2014, at 5:50 PM, Reid Kleckner <rnk at google.com <mailto:rnk at google.com>> wrote:
>>
>> On Mon, Nov 17, 2014 at 5:22 PM, Bob
2015 May 18
2
[LLVMdev] RFC: New EH representation for MSVC compatibility
On Mon, May 18, 2015 at 12:03 PM, Joseph Tremoulet <jotrem at microsoft.com>
wrote:
> Hi,
>
>
>
> Thanks for sending this out. We're looking forward to seeing this come
> about, since we need funclet separation for LLILC as well (and I have
> cycles to spend on it, if that would be helpful).
>
>
>
> Some questions about the new proposal:
>
>
>
2015 Feb 12
2
[LLVMdev] RFC: Native Windows C++ exception handling
> We'd have to hoist a + b to somewhere that dominates L1 and L2. I think the only BB in your program that dominates is the entry block
I don't follow. What path do you see from entry to either L1 or L2 that doesn't pass through the indirectbr? In order to reach either L1 or L2, the call to maybe_throw() must raise an exception (else we'd return 0 from foo), the exception must
2016 Jul 16
2
RFC: Strong GC References in LLVM
Hi Andy,
Andrew Trick wrote:
> At some point I stopped thinking about this as a bug and realized that
> you just need to think of LLVM as modeling speculative code barriers as
> memory dependence. In LLVM, it makes no sense to have a readonly
> may-throw call.
The problem is that that model breaks down with aggressive aliasing
like:
void foo(int* restrict ptr) {
*ptr = 40;
2015 Feb 13
2
[LLVMdev] C++ exception handling
I’m not sure I understand what you are suggesting in terms of how this should be handled.
I agree that the cleanup code is unlikely to be complex, but obviously we still need some way to handle any cases that unlikely but possible. I hadn’t even thought about what might be in a __finally block. I was thinking about destructors being inlined. Obviously that puts a practical limit on what will