[llvm-commits] [llvm] r150060 - in /llvm/trunk: include/llvm/IntrinsicsX86.td lib/Target/X86/X86ISelLowering.cpp lib/Target/X86/X86InstrSSE.td

Chandler Carruth chandlerc at google.com
Thu Feb 9 12:51:54 PST 2012


I think the primary problem here are the many definitions and
understandings of what 'intrinsics' mean.

To be clear, I think most of the LLVM developers have been operating under
the following assumption: intrinsics are a library-means of expressing
operations very useful or common on a particular system which have no
in-language formulation. As such, they are just a language extension with
defined and specified semantics. The compiler is then free to interpret
them, lower them, optimize, and even delete them according to the as-if
rules. I think that's fundamentally the *right* model, as there is no
alternative. If you want to express operations on SSE vectors, but would
like the compiler to have all of its usual freedom, what else can you use
besides intrinsics?

However...

On Thu, Feb 9, 2012 at 10:41 AM, David A. Greene <dag at cray.com> wrote:

> We absolutely need some way to tell LLVM, "leave this alone."  It goes
> beyond intrinsics even.
>

This is a very reasonable requirement, and I actually think LLVM has
exactly the means to deal with it: *volatile* inline asm. This says to the
compiler, explicitly and without ambiguity, "leave this alone". It must not
be changed, it must be preserved at all costs.

I think anything short of volatile inline asm is subject to as-if, and
merely a matter of time before the compiler begins optimizing even these
sequences.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20120209/1616c4e5/attachment.html>


More information about the llvm-commits mailing list