<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">Hi Fellows,<div><br></div><div>I’ve recently encountered a problem with X86 segment registers. </div><div><br></div><div>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 "<span style="font-family: Menlo; font-size: 11px;">Cannot emit physreg copy instruction</span>” which is in <span style="font-family: Menlo; font-size: 11px;">llvm::X86InstrInfo::copyPhysReg </span>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? </div><div><br></div><div>Thanks in advance!</div><div><br></div><div>Best,</div><div>Chen</div></body></html>