[llvm-dev] RFC: Add guard intrinsics to LLVM

Sanjoy Das via llvm-dev
Tue, 23 Feb 2016 05:58:56 -0000

On Mon, Feb 22, 2016 at 9:40 PM, Andrew Trick <atrick at apple.com>
wrote:
> I actually see fences as a proxy for potential inter-process
> communication and I/O. It's important that any opaque library call
> could contain a fence.

This makes perfect sense to me now, especially if you want to use
@trap_on for safety checks.  Without re-ordering restrictions, a
failed @trap_on will end up looking a lot like UB (since, say, you
could reorder a failing range check across a call to fflush); and so
that would be bad.  You'd still have to be careful around
inaccessiblememonly and friends, though.

-- Sanjoy