[llvm-dev] RFC: Allow readnone and readonly functions to throw exceptions

Daniel Berlin via llvm-dev llvm-dev at lists.llvm.org
Thu Jan 5 11:15:58 PST 2017


>
>
> In theory you could do this transform:
>
> void f(int*a) {
>   *a = 20;
>   call @mayunwind_readnone();
>   *a = 30;
> }
>
> =>
>
> void f(int*a) {
>   // *a = 20;
>   invoke @mayunwind_readnone() to %normal unwind %unwind
>
> normal:
>   *a = 30;
>   ret void
>
> unwind:
>   %exc = landingpad
>   *a = 20;
>   resume %exc
> }
>
> (That is, PRE the store around the implicit edge by making it explicit.)
>
> Generally though I don't see us doing this except under exceptional
> (no pun intended!) circumstances.
>


FWIW: I don't believe i've ever seen or written a modern PRE that doesn't
run screaming from exception edges.
(admittedly, most of them induce ordering constraints normal PRE algorithms
can't obey easily)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20170105/ea907412/attachment.html>


More information about the llvm-dev mailing list