Matt Pharr
2011-Aug-25 11:16 UTC
[LLVMdev] Trouble using the MCJIT: "Target does not support MC emission" error
I'm trying to wire up some code to use the MC-based JIT; my understanding is that it should be able to JIT AVX code (and that the regular JIT cannot). However, I'm getting the error "Target does not support MC emission!" when I call EngineBuilder::create(). I assume that I'm just not doing something necessary for initialization, but I'm not sure what it would be--I am calling all of: llvm::InitializeNativeTarget(); llvm::InitializeAllTargetMCs(); LLVMLinkInMCJIT(); LLVMLinkInJIT(); and the module I'm trying to load does have a reasonable target: target triple = "x86_64-apple-darwin11.0.0" I've attached a short test case that has the sequence of calls that I'm making and one of the bitcode files I'm trying to use. I'd be happy for any guidance or suggestions. Thanks, -matt -------------- next part -------------- A non-text attachment was scrubbed... Name: a.bc Type: application/octet-stream Size: 5088 bytes Desc: not available URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20110825/395c5dde/attachment.obj> -------------- next part -------------- A non-text attachment was scrubbed... Name: bug.cpp Type: application/octet-stream Size: 1830 bytes Desc: not available URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20110825/395c5dde/attachment-0001.obj>
Jim Grosbach
2011-Aug-25 14:52 UTC
[LLVMdev] Trouble using the MCJIT: "Target does not support MC emission" error
Hi Matt, You may want to have a look at lli in the llvm codebase. It can use the MCJIT for x86_64, so will have examples of all the setup required. Do note, however, that the MCJIT is relatively feature limited at this point. It's not (yet) a drop-in replacement for the old JIT. -Jim On Aug 25, 2011, at 4:16 AM, Matt Pharr wrote:> I'm trying to wire up some code to use the MC-based JIT; my understanding is that it should be able to JIT AVX code (and that the regular JIT cannot). However, I'm getting the error "Target does not support MC emission!" when I call EngineBuilder::create(). I assume that I'm just not doing something necessary for initialization, but I'm not sure what it would be--I am calling all of: > > llvm::InitializeNativeTarget(); > llvm::InitializeAllTargetMCs(); > LLVMLinkInMCJIT(); > LLVMLinkInJIT(); > > and the module I'm trying to load does have a reasonable target: > > target triple = "x86_64-apple-darwin11.0.0" > > I've attached a short test case that has the sequence of calls that I'm making and one of the bitcode files I'm trying to use. I'd be happy for any guidance or suggestions. > > Thanks, > -matt > > <a.bc><bug.cpp>_______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
Ralf Karrenberg
2011-Aug-25 17:12 UTC
[LLVMdev] Trouble using the MCJIT: "Target does not support MC emission" error
Hi Matt, I am unsure about MCJIT, but I guess the problem is the same. Just like when invoking llc, you need to pass the information to use AVX (llc -mattr=+avx). I guess the corresponding code should look like this: llvm::EngineBuilder engineBuilder(module); engineBuilder.setErrorStr(&eeError); engineBuilder.setEngineKind(llvm::EngineKind::JIT); engineBuilder.setUseMCJIT(true); engineBuilder.setMCPU("corei7-avx"); std::vector<std::string> attrs; attrs.push_back("avx"); engineBuilder.setMAttrs(attrs); llvm::ExecutionEngine *ee = engineBuilder.create(); Note that I have just today filed a bug report also related to jitted AVX: http://llvm.org/bugs/show_bug.cgi?id=10742 Thus, it might very well be the case that I am also mistaken and need to do something different. Best, Ralf Am 25.08.2011 13:16, schrieb Matt Pharr:> I'm trying to wire up some code to use the MC-based JIT; my understanding is that it should be able to JIT AVX code (and that the regular JIT cannot). However, I'm getting the error "Target does not support MC emission!" when I call EngineBuilder::create(). I assume that I'm just not doing something necessary for initialization, but I'm not sure what it would be--I am calling all of: > > llvm::InitializeNativeTarget(); > llvm::InitializeAllTargetMCs(); > LLVMLinkInMCJIT(); > LLVMLinkInJIT(); > > and the module I'm trying to load does have a reasonable target: > > target triple = "x86_64-apple-darwin11.0.0" > > I've attached a short test case that has the sequence of calls that I'm making and one of the bitcode files I'm trying to use. I'd be happy for any guidance or suggestions. > > Thanks, > -matt > > > > > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
Bruno Cardoso Lopes
2011-Aug-25 17:32 UTC
[LLVMdev] Trouble using the MCJIT: "Target does not support MC emission" error
Hi Ralf, FYI, old JIT doesn't support AVX at all, no encoding info, etc... The only way to use AVX+JIT is using MCJIT, which contains the correct encoding, but unfortunately the framework isn't good yet as the old one is. On Thu, Aug 25, 2011 at 10:12 AM, Ralf Karrenberg <Chareos at gmx.de> wrote:> Hi Matt, > > I am unsure about MCJIT, but I guess the problem is the same. > Just like when invoking llc, you need to pass the information to use AVX > (llc -mattr=+avx). > I guess the corresponding code should look like this: > > llvm::EngineBuilder engineBuilder(module); > engineBuilder.setErrorStr(&eeError); > engineBuilder.setEngineKind(llvm::EngineKind::JIT); > engineBuilder.setUseMCJIT(true); > engineBuilder.setMCPU("corei7-avx"); > std::vector<std::string> attrs; > attrs.push_back("avx"); > engineBuilder.setMAttrs(attrs); > llvm::ExecutionEngine *ee = engineBuilder.create(); > > Note that I have just today filed a bug report also related to jitted > AVX: http://llvm.org/bugs/show_bug.cgi?id=10742 > Thus, it might very well be the case that I am also mistaken and need to > do something different. > > Best, > Ralf > > Am 25.08.2011 13:16, schrieb Matt Pharr: >> I'm trying to wire up some code to use the MC-based JIT; my understanding is that it should be able to JIT AVX code (and that the regular JIT cannot). However, I'm getting the error "Target does not support MC emission!" when I call EngineBuilder::create(). I assume that I'm just not doing something necessary for initialization, but I'm not sure what it would be--I am calling all of: >> >> llvm::InitializeNativeTarget(); >> llvm::InitializeAllTargetMCs(); >> LLVMLinkInMCJIT(); >> LLVMLinkInJIT(); >> >> and the module I'm trying to load does have a reasonable target: >> >> target triple = "x86_64-apple-darwin11.0.0" >> >> I've attached a short test case that has the sequence of calls that I'm making and one of the bitcode files I'm trying to use. I'd be happy for any guidance or suggestions. >> >> Thanks, >> -matt >> >> >> >> >> _______________________________________________ >> LLVM Developers mailing list >> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu >> 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 >-- Bruno Cardoso Lopes http://www.brunocardoso.cc
Possibly Parallel Threads
- [LLVMdev] Trouble using the MCJIT: "Target does not support MC emission" error
- [LLVMdev] Trouble using the MCJIT: "Target does not support MC emission" error
- [LLVMdev] Trouble using the MCJIT: "Target does not support MC emission" error
- [LLVMdev] Trouble using the MCJIT: "Target does not support MC emission" error
- [LLVMdev] Trouble using the MCJIT: "Target does not support MC emission" error