My understanding was that compiling directly to native code wasn't supported on Windows yet. At least Clang seems to require having GCC in the path on Windows. -----Original Message----- From: Daniel Berlin [mailto:dberlin at dberlin.org] Sent: Tuesday, May 11, 2010 4:14 PM To: Michael Smith Cc: llvmdev at cs.uiuc.edu Subject: Re: [LLVMdev] Machine Code, JIT, and Windows On Tue, May 11, 2010 at 6:48 PM, Michael Smith <Michael.Smith at synopsys.com> wrote:> I'm writing an application that generates LLVM byte code and executes it at > runtime. The options I'm looking at are to use the LLVM ExecutionEngine for > JIT execution, or to write an assembly file, link it as a DLL using > gcc/mingw, and load the DLL. It has to work on Linux and Windows. > > > > I've been testing it on Windows, and found that the JIT execution, and > executing functions from a DLL are equally fast. Can anyone explain why? > When I test JIT, I don't have MinGW's GCC in the path, so I wouldn't expect > it to be compiling to native code.Why? LLVM does not require an external application to compile to native code. The JIT is in fact compiling to native code.> > > > Regards, > > Michael Smith > > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev > >
Hello Michael, That's for the final linkage. Since the JIT does linking at the bitcode level, it doesn't need to access an external linker AFAIK. --Sam ----- Original Message ----> From: Michael Smith <Michael.Smith at synopsys.com> > To: Daniel Berlin <dberlin at dberlin.org> > Cc: "llvmdev at cs.uiuc.edu" <llvmdev at cs.uiuc.edu> > Sent: Tue, May 11, 2010 6:49:52 PM > Subject: Re: [LLVMdev] Machine Code, JIT, and Windows > > My understanding was that compiling directly to native code wasn't supported on > Windows yet. At least Clang seems to require having GCC in the path on > Windows.-----Original Message----- From: Daniel Berlin [mailto:> ymailto="mailto:dberlin at dberlin.org" > href="mailto:dberlin at dberlin.org">dberlin at dberlin.org]Sent: Tuesday,> May 11, 2010 4:14 PMTo: Michael Smith Cc:> ymailto="mailto:llvmdev at cs.uiuc.edu" > href="mailto:llvmdev at cs.uiuc.edu">llvmdev at cs.uiuc.eduSubject: Re:> [LLVMdev] Machine Code, JIT, and WindowsOn Tue, May 11, 2010 at 6:48 PM,> Michael Smith<> href="mailto:Michael.Smith at synopsys.com">Michael.Smith at synopsys.com> > wrote: > I'm writing an application that generates LLVM byte code and > executes it at > runtime. The options I'm looking at are to use the LLVM > ExecutionEngine for > JIT execution, or to write an assembly file, link it > as a DLL using > gcc/mingw, and load the DLL. It has to work on Linux and > Windows. > > > > I've been testing it on Windows, and > found that the JIT execution, and > executing functions from a DLL are > equally fast. Can anyone explain why? > When I test JIT, I don't have > MinGW's GCC in the path, so I wouldn't expect > it to be compiling to > native code.Why? LLVM does not require an external application to> compile to native code.The JIT is in fact compiling to native> code. > > > > Regards, > > Michael > Smith > > _______________________________________________ > > LLVM Developers mailing list > > href="mailto:LLVMdev at cs.uiuc.edu">LLVMdev at cs.uiuc.edu > http://llvm.cs.uiuc.edu > > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev > >_______________________________________________ LLVM> Developers mailing list> href="mailto:LLVMdev at cs.uiuc.edu">LLVMdev at cs.uiuc.edu > > >http://llvm.cs.uiuc.edu> href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" target=_blank > >http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
Before MC, which changes this, LLVM didn't have the ability to assemble its own output into an object file. There is a special code path for the JIT, though, which allows the JIT to encode instructions in memory. It's the difference between being able to make "native code" and being able to make an object file or executable. The plan for the future (maybe this summer?) is to switch the JIT over to the new MC-based instruction encoders. Reid On Tue, May 11, 2010 at 9:03 PM, Samuel Crow <samuraileumas at yahoo.com> wrote:> Hello Michael, > > That's for the final linkage. Since the JIT does linking at the bitcode level, it doesn't need to access an external linker AFAIK. > > --Sam > > > > ----- Original Message ---- >> From: Michael Smith <Michael.Smith at synopsys.com> >> To: Daniel Berlin <dberlin at dberlin.org> >> Cc: "llvmdev at cs.uiuc.edu" <llvmdev at cs.uiuc.edu> >> Sent: Tue, May 11, 2010 6:49:52 PM >> Subject: Re: [LLVMdev] Machine Code, JIT, and Windows >> >> My understanding was that compiling directly to native code wasn't supported on >> Windows yet. At least Clang seems to require having GCC in the path on >> Windows. > > -----Original Message----- > From: Daniel Berlin [mailto: >> ymailto="mailto:dberlin at dberlin.org" >> href="mailto:dberlin at dberlin.org">dberlin at dberlin.org] > Sent: Tuesday, >> May 11, 2010 4:14 PM > To: Michael Smith > Cc: >> ymailto="mailto:llvmdev at cs.uiuc.edu" >> href="mailto:llvmdev at cs.uiuc.edu">llvmdev at cs.uiuc.edu > Subject: Re: >> [LLVMdev] Machine Code, JIT, and Windows > > On Tue, May 11, 2010 at 6:48 PM, >> Michael Smith > < >> href="mailto:Michael.Smith at synopsys.com">Michael.Smith at synopsys.com> >> wrote: >> I'm writing an application that generates LLVM byte code and >> executes it at >> runtime. The options I'm looking at are to use the LLVM >> ExecutionEngine for >> JIT execution, or to write an assembly file, link it >> as a DLL using >> gcc/mingw, and load the DLL. It has to work on Linux and >> Windows. >> >> >> >> I've been testing it on Windows, and >> found that the JIT execution, and >> executing functions from a DLL are >> equally fast. Can anyone explain why? >> When I test JIT, I don't have >> MinGW's GCC in the path, so I wouldn't expect >> it to be compiling to >> native code. > > Why? > LLVM does not require an external application to >> compile to native code. > The JIT is in fact compiling to native >> code. >> >> >> >> Regards, >> >> Michael >> Smith >> >> _______________________________________________ >> >> LLVM Developers mailing list >> >> href="mailto:LLVMdev at cs.uiuc.edu">LLVMdev at cs.uiuc.edu >> http://llvm.cs.uiuc.edu >> >> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev >> >> > > _______________________________________________ > LLVM >> Developers mailing list > >> href="mailto:LLVMdev at cs.uiuc.edu">LLVMdev at cs.uiuc.edu >> >> >http://llvm.cs.uiuc.edu > >> href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" target=_blank >> >http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev > > > > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev >