Xin Tong
2012-Jun-24 10:04 UTC
[LLVMdev] branch to a native instruction address from LLVM IR.
I would like to generate a branch/jump to a native instruction address (set up in the JIT runtime) in LLVM IR. It seems all the branch instructions (except indirect branch) takes a LLVM BasicBlock. What would be the best way to achieve this ? Thanks Xin
John Criswell
2012-Jun-25 14:36 UTC
[LLVMdev] branch to a native instruction address from LLVM IR.
On 6/24/12 5:04 AM, Xin Tong wrote:> I would like to generate a branch/jump to a native instruction address > (set up in the JIT runtime) in LLVM IR. It seems all the branch > instructions (except indirect branch) takes a LLVM BasicBlock. What > would be the best way to achieve this ?I don't think there's a way to do this in pure LLVM IR. However, I think you could insert an inline assembly code call instruction to do the jump. -- John T.> > Thanks > > Xin > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
Eli Friedman
2012-Jun-25 16:17 UTC
[LLVMdev] branch to a native instruction address from LLVM IR.
On Sun, Jun 24, 2012 at 3:04 AM, Xin Tong <xerox.time.tech at gmail.com> wrote:> I would like to generate a branch/jump to a native instruction address > (set up in the JIT runtime) in LLVM IR. It seems all the branch > instructions (except indirect branch) takes a LLVM BasicBlock. What > would be the best way to achieve this ?You probably want the "call" instruction; if you set it up as a tail call, the compiler will generate a "jmp" instruction. -Eli
Seemingly Similar Threads
- [LLVMdev] GPU thread/block/grid size contraints in LLVM PTX backend
- [LLVMdev] GPU thread/block/grid size contraints in LLVM PTX backend
- [LLVMdev] clang for opencl
- [LLVMdev] Bind a LLVM variable to a CPU register
- [LLVMdev] Bind a LLVM variable to a CPU register