<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Feb 18, 2008, at 1:24 PM, Andreas Fredriksson wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">2008/2/15, Andreas Fredriksson <<a href="mailto:deplinenoise@gmail.com">deplinenoise@gmail.com</a>>:<div><span class="gmail_quote"></span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"> I tried mocking this up using the following. (Base is what's returned as the Ax in the move expression above when the DAG is constructed due to SelectAddr().)<br><br>    SDOperand chain = CurDAG->getCopyToReg(Base, M68K::A3, Base);<br>     Base = CurDAG->getCopyFromReg(chain, M68K::A3, MVT::i32);<br></blockquote></div><br>Replying to myself here.<br><br>This worked a bit better :)<br><br>    const unsigned addressReg = RegMap->createVirtualRegister(&M68K::AR32RegClass);<br>     SDOperand chain = CurDAG->getCopyToReg(Base, addressReg, Base);<br>    Base = CurDAG->getCopyFromReg(chain, addressReg, MVT::i32);</blockquote><div><br class="webkit-block-placeholder"></div>This probably will produce correct code since the copy source and destination registers are of different register classes it's not in danger of being coalesced away. But as you have seen, it'll produce poor code. I think it's a reasonable step in the right direction though.</div><div><br class="webkit-block-placeholder"></div><div>Evan</div><div><br><blockquote type="cite"><br><br><br>// Andreas<br> _______________________________________________<br>LLVM Developers mailing list<br>LLVMdev@cs.uiuc.edu         <a href="http://llvm.cs.uiuc.edu">http://llvm.cs.uiuc.edu</a><br><a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br></blockquote></div><br></body></html>