使用特定的寄存器中LLVM变量 [英] Use a particular register for a variable in LLVM

查看:183
本文介绍了使用特定的寄存器中LLVM变量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我写的LLVM通行证,修改LLVM位code。对于一个变量,我想它使用的寄存器,说R15在x86。我怎样才能指导LLVM使用这个寄存器产生机器code是什么时候?可这在位code级指示?

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?

推荐答案

您可以使用内联汇编这一需求模型。有没有办法来配合特定的变量进行注册。

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

这篇关于使用特定的寄存器中LLVM变量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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