Model inline asm constraint which ties an input to an output register as machine operand TIED_TO constraint. This eliminated the need to pre-allocate registers for these. This also allows register allocator can eliminate the unneeded copies.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@67512 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Evan Cheng
2009-03-23 08:01:15 +00:00
parent 7d6d4b360f
commit fb11288109
10 changed files with 144 additions and 53 deletions

View File

@@ -135,14 +135,13 @@ public:
return (Flag & 0xffff) >> 3;
}
/// isOutputOperandTiedToUse - Return true if the flag of the inline asm
/// operand indicates it is an output that's matched to an input operand.
static bool isOutputOperandTiedToUse(unsigned Flag, unsigned &UseIdx) {
if (Flag & 0x80000000) {
UseIdx = Flag >> 16;
return true;
}
return false;
/// isUseOperandTiedToDef - Return true if the flag of the inline asm
/// operand indicates it is an use operand that's matched to a def operand.
static bool isUseOperandTiedToDef(unsigned Flag, unsigned &Idx) {
if ((Flag & 0x80000000) == 0)
return false;
Idx = (Flag & ~0x80000000) >> 16;
return true;
}