[LLVMdev] Add a 'notrap' function attribute?
Philip Reames
listmail at philipreames.com
Mon Nov 4 09:29:26 PST 2013
On 11/1/13 2:07 PM, Andrew Trick wrote:
>
> - I'm not sure why divide-by-zero would motivate this (probably just
> missing something). LLVM doesn't model it as a trap currently. And if
> it did, an explicit nonzero-divisor check would be easy to reason
> about without any metadata.
This is far enough off topic to not be worth discussing now, but I want
to throw out that there would be interested parties in defining trapping
versions of LLVM instructions which currently use undef semantics for
edge cases. We haven't dug into this much yet, but it is something
we're probably going to be interested in long term. Our initial approach
is to simply use explicit conditional guards to handle things like
div-by-zero and null-dereference. Depending on the performance we see
with that approach, we may be interested in implementing support for
implicit checks which would likely require explicitly trapping semantics.
Philip
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20131104/8ec3f689/attachment.html>
More information about the llvm-dev
mailing list