是否可以将汇编语言转换为LLVM IR,对其进行优化,然后将其重新编译为其他体系结构? [英] Is it possible to translate an assembly language to LLVM IR, optimize it and then recompile it to a different architecture?

查看:541
本文介绍了是否可以将汇编语言转换为LLVM IR,对其进行优化,然后将其重新编译为其他体系结构?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以将汇编语言转换为LLVM IR,对其进行优化,然后将其重新编译为其他体系结构?您将如何处理IR中堆栈上的推送"和弹出"?这是我发现的最简单的异议,但是我敢肯定会有很多这样的事情.

Is it possible to translate an assembly language to LLVM IR, optimize it and then recompile it to a different architecture? How would you handle "push"es and "pop"s on the stack in the IR? This is the simplest objection I found, but I'm sure that there're tons like this.

我正计划构建一个动态的重新编译器,这似乎是一个很好的解决方案,因为LLVM会针对新架构自动优化我的代码. LLVM可以实现所有这些功能吗?

I'm planning to build a dynamic recompiler, and it seems that this would be an excellent solution, since LLVM would automatically optimize my code for the new architecture. Is all this possible with LLVM?

谢谢

推荐答案

这是一个类似的问题:

This is a similar question: Recompile a x86 code with LLVM to some faster one x86

答案是LLVM不能直接做到这一点,但可以用作实现该目标的工具的一部分.

The answer is that LLVM can't do it directly, but could be used as part of a tool that does.

这篇关于是否可以将汇编语言转换为LLVM IR,对其进行优化,然后将其重新编译为其他体系结构?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆