Don't inflate register classes used by inline asm.
authorJakob Stoklund Olesen <stoklund@2pi.dk>
Fri, 1 Jul 2011 01:24:25 +0000 (01:24 +0000)
committerJakob Stoklund Olesen <stoklund@2pi.dk>
Fri, 1 Jul 2011 01:24:25 +0000 (01:24 +0000)
The constraints are represented by the register class of the original
virtual register created for the inline asm. If the register class were
included in the operand descriptor, we might be able to do this.

For now, just give up on regclass inflation when inline asm is involved.

No test case, this bug hasn't happened yet.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134226 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CalcSpillWeights.cpp

index 74c43ccbe5ea9951708841b523603a3bdad98c8c..e6b3bbca2068257f1e9949563f4f2cf1e94c0361 100644 (file)
@@ -203,6 +203,9 @@ void VirtRegAuxInfo::CalculateRegClass(unsigned reg) {
     // TRI doesn't have accurate enough information to model this yet.
     if (I.getOperand().getSubReg())
       return;
+    // Inline asm instuctions don't remember their constraints.
+    if (I->isInlineAsm())
+      return;
     const TargetRegisterClass *OpRC =
       TII->getRegClass(I->getDesc(), I.getOperandNo(), TRI);
     if (OpRC)