Refine EarlyClobber assert in register scavenger.

It is legal for an inline asm operand to use an earlyclobber register if the
use operand is tied to the earlyclobber operand. The issue is discussed here:

  http://gcc.gnu.org/ml/gcc/1999-04n/msg00431.html

We should perhaps let only the machine code verifier worry about these finer
details. EarlyClobber operands are not really interesting to the scavenger.

This fixes PR4528 for the third time.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79122 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Jakob Stoklund Olesen
2009-08-15 18:16:58 +00:00
parent d7e250527c
commit 16b794d25a
2 changed files with 43 additions and 1 deletions

View File

@@ -236,7 +236,7 @@ void RegScavenger::forward() {
continue;
if (MO.isUse()) {
assert(isUsed(Reg) && "Using an undefined register!");
assert(!EarlyClobberRegs.test(Reg) &&
assert((!EarlyClobberRegs.test(Reg) || MI->isRegTiedToDefOperand(i)) &&
"Using an early clobbered register!");
} else {
assert(MO.isDef());