问题
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