Use a particular register for a variable in LLVM

旧城冷巷雨未停 提交于 2019-12-12 03:07:28

问题


I am writing an LLVM pass which modifies the LLVM bitcode. For one variable, I want it to use a register, say R15 on x86. How can I instruct LLVM to use this register when generating machine code? Can this be instructed at the bitcode level?


回答1:


You can use inline assembler to model this requirement. There is no way to "tie" specific variable to register.



来源:https://stackoverflow.com/questions/9897726/use-a-particular-register-for-a-variable-in-llvm

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!