[PATCH] D66980: [Windows] Disable TrapUnreachable for Win64, add SEH_NoReturn
Reid Kleckner via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Sep 3 15:32:22 PDT 2019
rnk added a comment.
In D66980#1653723 <https://reviews.llvm.org/D66980#1653723>, @mstorsjo wrote:
> So I presume that the issue is that the new `int3` isn't at the end of the function where the previous double `ud2` were?
The old ud2 should have become int3, and there was no need to add an int3 after cxa_throw, that was undesired. I ended up reverting this change in rL370829 <https://reviews.llvm.org/rL370829>. There were two issues:
1. SEH_NoReturn expansion needs to look across blocks similar to what SEH_Epilogue does
2. _Unwind_Resume is not marked noreturn
Furthermore, noreturn is supposed to be an optimization hint, not a requirement for correctness. We should really be expanding all unreachable instructions to this SEH_NoReturn pseudo, like a disappearing-ink version of TrapUnreachable. I tried to implement that, but it was hard because it interacts with target independent fast isel. And after all, I'm not sure I like this pseudo instruction that expands to something else based on some non-local analysis. I'm starting to think this should be a standalone pass that inserts int3 as needed at the end of every function and funclet that ends in a call instruction. It would be so simple, and wouldn't need 3 implementations in SDISel, FastISel, and global ISel.
Repository:
rL LLVM
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D66980/new/
https://reviews.llvm.org/D66980
More information about the llvm-commits
mailing list