[LLVMdev] Use SEGMENT_REG in X86 calling convention

Chen Li meloli87 at gmail.com
Fri Feb 21 14:12:25 PST 2014


Hi Fellows,

I’ve recently encountered a problem with X86 segment registers. 

I created a new calling convention and for some purposes I have to use a segment register for one of the argument passed by the caller.  I found out that in X86RegisterInfo.td, SEGMENT_REG was defined there, and I directly grabbed the one I need into my calling convention in X86CallingConv.td. However, I got an error while I was trying to codegen a function with my specific calling convention. The error is "Cannot emit physreg copy instruction” which is in llvm::X86InstrInfo::copyPhysReg when it tries to copy the segment register. I think the problem occurs at the beginning of the function when it tries to get the argument from the segment register. Does anyone have any idea on how to fix it or the correct way to use the segment register? 

Thanks in advance!

Best,
Chen
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20140221/f6b9f120/attachment.html>


More information about the llvm-dev mailing list