<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"><base href="x-msg://145/"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Dec 5, 2012, at 11:39 AM, "Weiming Zhao" <<a href="mailto:weimingz@codeaurora.org">weimingz@codeaurora.org</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div lang="EN-US" link="blue" vlink="purple" style="font-family: Optima; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div class="WordSection1" style="page: WordSection1; "><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif; "><span style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125); ">Hi Jakob,<o:p></o:p></span></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif; "><span style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125); "> </span></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif; "><span style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125); ">I tried your suggestion for ldrexd of inlineasm. It works now. Could you please check my steps below and see if I’m on the right track:<o:p></o:p></span></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif; "><span style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125); "> </span></div><div style="margin: 0in 0in 0.0001pt 0.5in; font-size: 12pt; font-family: 'Times New Roman', serif; text-indent: -0.25in; "><span style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125); "><span>1.<span style="font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-family: 'Times New Roman'; ">      <span class="Apple-converted-space"> </span></span></span></span><span style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125); ">In DAG selection for inlineAsm, I use createGPRPairNode() instead of createVirtualRegister() to replace the original two GPRs. The use of the original two GPRs are replaced with Extract_Subreg node. So the code would be like:<o:p></o:p></span></div><div style="margin: 0in 0in 0.0001pt 0.5in; font-size: 12pt; font-family: 'Times New Roman', serif; "><span style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125); ">Vreg0 = REG_SEQUENCE(..);  INLNEASM (… VReg0);  Vreg1 = Extract_subreg vreg0, idx_0; …</span></div></div></div></blockquote><div><br></div><div>It looks like you are confusing the inputs and outputs to the inline asm. They should be handled completely separately.</div><blockquote type="cite"><div lang="EN-US" link="blue" vlink="purple" style="font-family: Optima; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div class="WordSection1" style="page: WordSection1; "><div style="margin: 0in 0in 0.0001pt 0.5in; font-size: 12pt; font-family: 'Times New Roman', serif; "><span style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125); "> </span></div><div style="margin: 0in 0in 0.0001pt 0.5in; font-size: 12pt; font-family: 'Times New Roman', serif; text-indent: -0.25in; "><span style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125); "><span>2.<span style="font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-family: 'Times New Roman'; ">      <span class="Apple-converted-space"> </span></span></span></span><span style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125); ">I have to fix INLINEASM case of InstrEmitter::EmitSpecialNode() to let it accept a REG_SEQUENCE node as well. Currently, it only expects a RegisterSDNode for InlineAsm::Kind_RegDefEarlyClobber/Kind_Clobber.</span></div></div></div></blockquote><div><br></div><div>I think that outputs from an inlineasm must go through virtual registers with a glued copyFromReg node.</div><div><br></div><blockquote type="cite"><div lang="EN-US" link="blue" vlink="purple" style="font-family: Optima; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div class="WordSection1" style="page: WordSection1; "><div style="margin: 0in 0in 0.0001pt 0.5in; font-size: 12pt; font-family: 'Times New Roman', serif; "><span style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125); "> </span><span style="text-indent: -0.25in; font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125); ">3.<span style="font-size: 7pt; font-family: 'Times New Roman'; ">       </span></span><span style="text-indent: -0.25in; font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125); ">  I have to fix InstrEmitter::EmitSubregNode by changing “MachineInstr *DefMI = MRI->getVRegDef(VReg)” to “MachineInstr *DefMI = MRI->getUniqueVRegDef(VReg)”. The reason is vreg0 is defined by both REQ_Sequence and InlineAsm.</span></div></div></div></blockquote><div><br></div><div>No. InstrEmitter is producing SSA form. If you have multiple defs of a virtual register, something is very wrong.</div><div><br></div><div>You should start by figuring out what the DAG looks like when an inline asm node is 1. reading, and 2. writing a GPRPair value. It shouldn't be that different from other kinds of registers.</div><div><br></div><div>/jakob</div><div><br></div></div></body></html>