I'm new to llvm. I figured out that the llvm front-end translate the high level language to IR. the back-end translate the IR to machine ASM or machine code. then, if their is inline ASM in the high level language, what will the frond-end do? will the ASM be translated to llvm IR? will the JIT still work? how the back-end recognize the inline asm? thanks. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20140813/0ea4cb47/attachment.html>
On 8/13/14, 9:03 AM, jiangshan wrote:> I'm new to llvm. > I figured out that the llvm front-end translate the high level > language to IR. the back-end translate the IR to machine ASM or > machine code. > then, if their is inline ASM ?in the high level language, what will > the frond-end do? will the ASM ?be translated to llvm IR?The LLVM IR encodes inline assembly as a special type of value which can then be used in a call instruction. The LLVM IR also has a way of encoding module-level assembly code. Please see http://llvm.org/docs/LangRef.html#inline-assembler-expressions and http://llvm.org/docs/LangRef.html#module-level-inline-assembly for more details. Regards, John Criswell -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20140813/44f18137/attachment.html>
A useful tool/technique is to simply ask "What Would Clang Do?" and answer that question by running clang with -emit-llvm -S and inspecting the resulting textual LLVM IR - gives you a pretty good idea of how things are (or can be) encoded into LLVM IR from arbitrary {Objective-,}C{++,} On Wed, Aug 13, 2014 at 6:03 AM, jiangshan <710806594 at qq.com> wrote:> I'm new to llvm. > I figured out that the llvm front-end translate the high level language to > IR. the back-end translate the IR to machine ASM or machine code. > then, if their is inline ASM in the high level language, what will the > frond-end do? will the ASM be translated to llvm IR? > will the JIT still work? > how the back-end recognize the inline asm? > thanks. > > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev >