[LLVMdev] More address registers
Evan Cheng
evan.cheng at apple.com
Tue Feb 19 10:47:05 PST 2008
On Feb 18, 2008, at 1:24 PM, Andreas Fredriksson wrote:
> 2008/2/15, Andreas Fredriksson <deplinenoise at gmail.com>:
> 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().)
>
> SDOperand chain = CurDAG->getCopyToReg(Base, M68K::A3, Base);
> Base = CurDAG->getCopyFromReg(chain, M68K::A3, MVT::i32);
>
> Replying to myself here.
>
> This worked a bit better :)
>
> const unsigned addressReg = RegMap-
> >createVirtualRegister(&M68K::AR32RegClass);
> SDOperand chain = CurDAG->getCopyToReg(Base, addressReg, Base);
> Base = CurDAG->getCopyFromReg(chain, addressReg, MVT::i32);
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.
Evan
>
>
>
> // Andreas
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20080219/bbd826d9/attachment.html>
More information about the llvm-dev
mailing list