<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Tahoma
}
--></style>
</head>
<body class='hmmessage'><div dir='ltr'>
Sorry, menat to upload this to the list.<br><br><div>> From: greened@obbligato.org<br>> To: mclagett@hotmail.com<br>> CC: llvmdev@cs.uiuc.edu<br>> Subject: Re: [LLVMdev] LLVM IR is a compiler IR<br>> Date: Thu, 6 Oct 2011 14:02:48 -0500<br>> <br>> Michael Clagett <mclagett@hotmail.com> writes:<br>> <br>> > There's about 32 core op codes that constitute the basic instruction<br>> > set and I can envision mapping each of these to some sequence of LLVM<br>> > IR.  There's also a whole lot more "extended opcodes" that are<br>> > executed by the same core instruction execution loop but which are<br>> > coded using the built-in Intel assembler and added dynamically by the<br>> > system.  I could envision also going to the trouble of mapping each of<br>> > these to a sequence of LLVM IR instructions and then being able to<br>> > emit a series of LLVM IR sequences purely based on the sequence of vm<br>> > opcodes encountered in a scan of code compiled for the vm.<br>> <br>> > I'm hoping that such a product could then be submitted to all the LLVM<br>> > optimizations and result in better Intel assembly code generation than<br>> > what I have hand-coded myself (in my implementations of either the<br>> > core or the extended opcodes -- and especially in the intel code<br>> > sequences resulting from the use of these opcodes in sequences<br>> > together).  So first question is simply to ask for a validation of<br>> > this thinking and whether such a strategy seems feasible.<br>> <br>> Let me make sure I'm understanding you correctly.  You want to map each<br>> of you opcodes into an LLVM sequence and then use the LLVM optimizations<br>> and JIT to generate efficient native code implementations?  Then you<br>> would invoke those implementations during interpretation?<br>> <br>> Or is it that you want to take a bytecode program, map it to LLVM IR,<br>> run it through optimizations and codegen to produce a native executable?<br>> <br>> Either one of these will work and LLVM seems like a good match as long<br>> as you don't expect the optimizations to understand the higher-level<br>> semantics of your opcodes (without some work by you, at least).<br>> <br>> I don't quiet grasp any benefit to the first use as I would just go<br>> ahead and generate the optimal native code sequence for each opcode once<br>> and be done with it.  No LLVM needed at all.  So I suspect this is not<br>> what you want to do<br>> <br>>                              -Dave<br></div>                                    </div></body>
</html>