Manjunath Kudlur
2010-Aug-04 21:40 UTC
[LLVMdev] JITing code with indirect branch in LLVM 2.7
I am trying to JIT some code containing an indirect branch (and the corresponding store i8* blockaddress(@label)). I am using LLVM 2.7 code base. I build the ExecutionEngine using EngineBuilder, and call engine->getPointerToFunction(func). When I use setOptLevel(llvm::CodeGenOpt::None), the JITing fails with the following message : JIT.h:131: virtual void* llvm::JIT::getPointerToBasicBlock(llvm::BasicBlock*): Assertion `0 && "JIT does not support address-of-label yet!"' failed. However, when I use setOptLevel(llvm::CodeGenOpt::Less) or higher (Default, Aggressive), the assertion does not happen. However, when I disassemble the JITed program, I see that the label getting stored is wrong, it is not in the range of the function's code space. I am wondering whether I am doing something wrong. Does the JIT mode not support indirect branches? Manjunath
Reid Kleckner
2010-Aug-04 21:52 UTC
[LLVMdev] JITing code with indirect branch in LLVM 2.7
Here's the bug about it: http://llvm.org/bugs/show_bug.cgi?id=6744 There's a patch in progress there. Reid On Wed, Aug 4, 2010 at 2:40 PM, Manjunath Kudlur <keveman at gmail.com> wrote:> I am trying to JIT some code containing an indirect branch (and the > corresponding store i8* blockaddress(@label)). I am using LLVM 2.7 > code base. I build the ExecutionEngine using EngineBuilder, and call > engine->getPointerToFunction(func). When I use > setOptLevel(llvm::CodeGenOpt::None), the JITing fails with the > following message : > > JIT.h:131: virtual void* > llvm::JIT::getPointerToBasicBlock(llvm::BasicBlock*): Assertion `0 && > "JIT does not support address-of-label yet!"' failed. > > However, when I use setOptLevel(llvm::CodeGenOpt::Less) or higher > (Default, Aggressive), the assertion does not happen. However, when I > disassemble the JITed program, I see that the label getting stored is > wrong, it is not in the range of the function's code space. I am > wondering whether I am doing something wrong. Does the JIT mode not > support indirect branches? > > Manjunath > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev >