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
typeinfos and personality functions should be attached to the invoke #1880
Comments
I agree, but I don't know the right solution for this :) |
Some thoughts on exception handling intrinsics. (1) eh.typeid.for Solutions: Hopefully this expanded code would be efficiently simplified by running a few (y) Add the personality function as an additional eh.typeid.for argument. (2) eh.selector |
Additional problems with the current eh.selector lowering: |
Likewise for two filters or mixes of filters and selectors. This |
The test above fails with llvm-as < test | opt -std-compile-opts | llc -enable-eh |
Split is done in LoopSimplify::SplitBlockPredecessors which does not know about landing pads, and needs to. |
It sounds like this problem needs to get a bug report of its own, |
I don't think so; the loop splitting is an issue only because of the underlying problem: |
If I understand right, whats happening here is that before the Bar
... unwind: ; preds = %unwind.loopexit, %entry in which the calls to the exception handling intrinsics have been |
That's not exactly how this arose. Originally there was a single landing pad, unwind, which could be reached from either Foo or Bar (the latter inside a loop). The loop optimizer decided to split the |
How about simply removing the assertion (SelectionDAGISel.cpp:4495)? |
I tried that and (after turning off various other checking that it broke) the EH tables did not look right, although I don't grok them well enough to be sure. The trouble is that the original 'unwind' is still a valid landing pad, reached from Foo. |
The tables look fine to me, so I've committed this. It's not clear to |
Looks good. I thought there had to be a 1-1 correspondence between selectors and landing pads, I think, but there doesn't. Thanks for fixing this. |
If you are happy, can you please check in the testcase. |
Some additional thoughts on this: it may be possible to eliminate the (1) as a way of getting hold of the value in the selector register As far as (1) is concerned there is no real problem if the selector As for (2), since currently we only support one personality per So now for (3). I'm not going to discuss filters here - I plan What is the list of typeids in the selector call for? compare the exception with typeinfo T1 The list of eh.selector typeinfos is exactly B1, ..., BN. Why does eh.selector want to assemble this list at all? Thus we could do the following scheme: remove the list So how do you query the runtime to find out whether the |
llvm/llvm-bugzilla-archive#2157 . |
Note that the llvm.eh.compare intrinsic would be readonly (and even Also note that the required analysis at the codegen level is |
Duncan, This is done, no? :-) |
Bill fixed this. |
mentioned in issue llvm/llvm-bugzilla-archive#1682 |
mentioned in issue llvm/llvm-bugzilla-archive#1914 |
Extended Description
Exception handling typeinfos and personality functions are currently
supplied by an intrinsic (eh.selector or eh.filter) that is placed in
the invoke landing pad. This is a flawed scheme: the optimizers can move
the intrinsic out of the landing pad. How then to know to which landing
pad the typeinfos and personality should be applied? This is exactly what
happens to the intrinsics in landing pad unwind871 in
test/CodeGen/Generic/2007-06-06-CriticalEdgeLandingPad.ll
[The optimizers insert a critical edge basic block; this becomes
the landing pad, with the intrinsics in the successor. You can tell
that the type infos got lost because the exception action for the
invoke in cond_true870 is 1, i.e. cleanups only, rather than 5].
This PR is for discussion of how best to fix this issue.
The text was updated successfully, but these errors were encountered: