[LLVMdev] Inline Assembly

Reid Spencer reid at x10sys.com
Mon Sep 13 08:22:45 PDT 2004


In order to get to the next stage with LLVM (like compiling a kernel) we
need to allow "pass through" of inline assembly so things like device
drivers, interrupt vectors, etc. can be written. While this feature
breaks the "pure" LLVM IR, I don't see any way around it. 

So, I thought I'd bring it up here so we can discuss potential
implementations.  I think we should take the "shoot yourself in the foot
approach". That is, we add an instruction type to LLVM that simply
encapsulates an assembly language statement. This instruction type is
just simply ignored (but retained) by all the optimization passes. When
code generation happens, the inline assembly is just blindly put out and
if the programmer has shot himself in the foot, so be it.

One other thing we can do that *might* be useful. If a function contains
only inline assembly instructions, we could circumvent the usual calling
conventions for that function.

Thoughts?

Reid.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20040913/caf22927/attachment.sig>


More information about the llvm-dev mailing list