[cfe-dev] Status of __builtin_unreachable in clang

Stephan Tolksdorf st at quanttec.com
Thu Oct 24 11:10:59 PDT 2013


I have moved this thread to llvmdev.

See also http://llvm.org/bugs/show_bug.cgi?id=810


On 03.10.13 21:04, Stephan Tolksdorf wrote:
> The GCC optimizer exploits statements like
>
>    if (x < 0) __builtin_unreachable();
>
> to infer that x must be non-negative. This way one can communicate value
> constraints to the optimizer that the optimizer otherwise couldn't infer
> itself. MSVC supports the  __assume intrinsic for the same purpose.
>
> clang/LLVM currently does not seem to be able to exploit
> __builtin_unreachable() in this way. I'm curious, are there any plans to
> change this in the future?
>
> I found this related note by Chris Lattner:
> http://nondot.org/sabre/LLVMNotes/BuiltinUnreachable.txt
>
> - Stephan
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev




More information about the cfe-dev mailing list