Implement the getRegForInlineAsmConstraint method for PPC. With recent
authorChris Lattner <sabre@nondot.org>
Thu, 2 Nov 2006 01:44:04 +0000 (01:44 +0000)
committerChris Lattner <sabre@nondot.org>
Thu, 2 Nov 2006 01:44:04 +0000 (01:44 +0000)
commit331d1bc5dfe1be9090e29f9af9579888a63a9a79
tree3491c52c7ece828f32b3696fb4801a0a8f755af6
parent2a821601f1db665fbb825727aacf1a54d17b91ef
Implement the getRegForInlineAsmConstraint method for PPC.  With recent
sdisel changes, this eliminates a ton of copies around common inline asms.
For example:

int test2(int Y, int X) {
  asm("foo %0, %1" : "=r"(X): "r"(X));
  return X;
}

now compiles to:

_test2:
        foo r3, r4
        blr

instead of:

_test2:
        mr r2, r4
        foo r2, r2
        mr r3, r2
        blr

GCC produces:

_test2:
        foo r4, r4
        mr r3,r4
        blr

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31367 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/PowerPC/PPCISelLowering.cpp
lib/Target/PowerPC/PPCISelLowering.h