Alberto Barbaro via llvm-dev
2018-Nov-18 17:59 UTC
[llvm-dev] How to add instructions to a Module at runtime?
Hi David, Thanks for your answer. Just to clarify, I would like to create 2 3 instructions put them in a function and execute them. Do you still think the JIT would be the best option? Thanks On Sun, Nov 18, 2018, 12:55 David Blaikie <dblaikie at gmail.com wrote:> If you're looking to execute code at runtime (within th eam process - or > across a network etc - as the one that compiles that code (rather than > writing an executable/object code to dusk etc)) sounds like you're looking > for a JIT. Here's some info on how to use/write a JIT using llvm: > https://llvm.org/docs/tutorial/BuildingAJIT1.html > > On Sun, Nov 18, 2018, 5:53 AM Alberto Barbaro via llvm-dev < > llvm-dev at lists.llvm.org wrote: > >> Hi all, >> I'm trying to understand how the Module object works more in details, so >> suppose I've an empty module and I'd like to know if it is possible to add >> instructions at runtime and execute it. Is it possible to do it? Any >> suggestion on how? >> >> Thanks >> _______________________________________________ >> LLVM Developers mailing list >> llvm-dev at lists.llvm.org >> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev >> >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20181118/2b3fe1ed/attachment.html>
David Blaikie via llvm-dev
2018-Nov-18 18:20 UTC
[llvm-dev] How to add instructions to a Module at runtime?
As far as LLVM is concerned, yeah. Though if you have that small amount of code it might be quicker to interpret it directly rather than going all the way into/through llvm On Sun, Nov 18, 2018, 12:59 PM Alberto Barbaro <barbaro.alberto at gmail.com wrote:> Hi David, > Thanks for your answer. Just to clarify, I would like to create 2 3 > instructions put them in a function and execute them. Do you still think > the JIT would be the best option? > > Thanks > > On Sun, Nov 18, 2018, 12:55 David Blaikie <dblaikie at gmail.com wrote: > >> If you're looking to execute code at runtime (within th eam process - or >> across a network etc - as the one that compiles that code (rather than >> writing an executable/object code to dusk etc)) sounds like you're looking >> for a JIT. Here's some info on how to use/write a JIT using llvm: >> https://llvm.org/docs/tutorial/BuildingAJIT1.html >> >> On Sun, Nov 18, 2018, 5:53 AM Alberto Barbaro via llvm-dev < >> llvm-dev at lists.llvm.org wrote: >> >>> Hi all, >>> I'm trying to understand how the Module object works more in details, so >>> suppose I've an empty module and I'd like to know if it is possible to add >>> instructions at runtime and execute it. Is it possible to do it? Any >>> suggestion on how? >>> >>> Thanks >>> _______________________________________________ >>> LLVM Developers mailing list >>> llvm-dev at lists.llvm.org >>> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev >>> >>-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20181118/bc67874b/attachment.html>
Alberto Barbaro via llvm-dev
2018-Nov-18 19:08 UTC
[llvm-dev] How to add instructions to a Module at runtime?
Thanks David, I'm trying to take the long way because I'd really understand what it is happening instead of just using it :) Thanks On Sun, Nov 18, 2018, 18:20 David Blaikie <dblaikie at gmail.com wrote:> As far as LLVM is concerned, yeah. Though if you have that small amount of > code it might be quicker to interpret it directly rather than going all the > way into/through llvm > > On Sun, Nov 18, 2018, 12:59 PM Alberto Barbaro <barbaro.alberto at gmail.com > wrote: > >> Hi David, >> Thanks for your answer. Just to clarify, I would like to create 2 3 >> instructions put them in a function and execute them. Do you still think >> the JIT would be the best option? >> >> Thanks >> >> On Sun, Nov 18, 2018, 12:55 David Blaikie <dblaikie at gmail.com wrote: >> >>> If you're looking to execute code at runtime (within th eam process - or >>> across a network etc - as the one that compiles that code (rather than >>> writing an executable/object code to dusk etc)) sounds like you're looking >>> for a JIT. Here's some info on how to use/write a JIT using llvm: >>> https://llvm.org/docs/tutorial/BuildingAJIT1.html >>> >>> On Sun, Nov 18, 2018, 5:53 AM Alberto Barbaro via llvm-dev < >>> llvm-dev at lists.llvm.org wrote: >>> >>>> Hi all, >>>> I'm trying to understand how the Module object works more in details, >>>> so suppose I've an empty module and I'd like to know if it is possible to >>>> add instructions at runtime and execute it. Is it possible to do it? Any >>>> suggestion on how? >>>> >>>> Thanks >>>> _______________________________________________ >>>> LLVM Developers mailing list >>>> llvm-dev at lists.llvm.org >>>> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev >>>> >>>-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20181118/1f972d7b/attachment.html>