Ignore register mask operands when lowering instructions to MC.
authorJakob Stoklund Olesen <stoklund@2pi.dk>
Wed, 18 Jan 2012 23:52:19 +0000 (23:52 +0000)
committerJakob Stoklund Olesen <stoklund@2pi.dk>
Wed, 18 Jan 2012 23:52:19 +0000 (23:52 +0000)
This is similar to implicit register operands.  MC doesn't understand
register liveness and call clobbers.

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

lib/Target/ARM/ARMMCInstLower.cpp
lib/Target/MBlaze/MBlazeMCInstLower.cpp
lib/Target/MSP430/MSP430MCInstLower.cpp
lib/Target/Mips/MipsMCInstLower.cpp
lib/Target/PowerPC/PPCMCInstLower.cpp
lib/Target/X86/X86MCInstLower.cpp

index daa126def401753ae204e612cd67fbf521107b87..a63a94dc76b0f7c83e8744787a67ad6d7f82f16c 100644 (file)
@@ -107,6 +107,9 @@ bool ARMAsmPrinter::lowerOperand(const MachineOperand &MO,
     MCOp = MCOperand::CreateFPImm(Val.convertToDouble());
     break;
   }
+  case MachineOperand::MO_RegisterMask:
+    // Ignore call clobbers.
+    return false;
   }
   return true;
 }
index 7e5598f56a82e2cc72ab23e9859a4a707166f955..858d54b895d220828d946a4cb879482bf737974e 100644 (file)
@@ -150,7 +150,7 @@ void MBlazeMCInstLower::Lower(const MachineInstr *MI, MCInst &OutMI) const {
     case MachineOperand::MO_BlockAddress:
       MCOp = LowerSymbolOperand(MO, GetBlockAddressSymbol(MO));
       break;
-    case MachineOperand::MO_FPImmediate:
+    case MachineOperand::MO_FPImmediate: {
       bool ignored;
       APFloat FVal = MO.getFPImm()->getValueAPF();
       FVal.convert(APFloat::IEEEsingle, APFloat::rmTowardZero, &ignored);
@@ -160,6 +160,9 @@ void MBlazeMCInstLower::Lower(const MachineInstr *MI, MCInst &OutMI) const {
       MCOp = MCOperand::CreateImm(Val);
       break;
     }
+    case MachineOperand::MO_RegisterMask:
+      continue;
+    }
 
     OutMI.addOperand(MCOp);
   }
index d1d9a115863543f0217e217da85ecb434c865efb..cd84db8a5e47d90aac0a5fcde1ab2edb905b87c5 100644 (file)
@@ -143,6 +143,9 @@ void MSP430MCInstLower::Lower(const MachineInstr *MI, MCInst &OutMI) const {
       break;
     case MachineOperand::MO_BlockAddress:
       MCOp = LowerSymbolOperand(MO, GetBlockAddressSymbol(MO));
+      break;
+    case MachineOperand::MO_RegisterMask:
+      continue;
     }
 
     OutMI.addOperand(MCOp);
index 01b20b19f6b8dedacb4fad748c075367867fdb41..541386543880d3259a61d2b68fd9e76d604c2a63 100644 (file)
@@ -192,6 +192,8 @@ MCOperand MipsMCInstLower::LowerOperand(const MachineOperand& MO,
   case MachineOperand::MO_ConstantPoolIndex:
   case MachineOperand::MO_BlockAddress:
     return LowerSymbolOperand(MO, MOTy, offset);
+  case MachineOperand::MO_RegisterMask:
+    break;
  }
 
   return MCOperand();
index 33af4269a3ad21636ae46a9f6cd689b181e55967..ff6ebbad97217c4510627ca053ce8ae71908d569 100644 (file)
@@ -166,6 +166,8 @@ void llvm::LowerPPCMachineInstrToMCInst(const MachineInstr *MI, MCInst &OutMI,
       MCOp = GetSymbolRef(MO,AP.GetBlockAddressSymbol(MO.getBlockAddress()),AP,
                           isDarwin);
       break;
+    case MachineOperand::MO_RegisterMask:
+      continue;
     }
     
     OutMI.addOperand(MCOp);
index 1f7d42240c1f423b16693bde213abbf46f53117e..8955458ed8c96d81d8dcfc811ec2ed95dd92428e 100644 (file)
@@ -335,6 +335,9 @@ void X86MCInstLower::Lower(const MachineInstr *MI, MCInst &OutMI) const {
       MCOp = LowerSymbolOperand(MO,
                      AsmPrinter.GetBlockAddressSymbol(MO.getBlockAddress()));
       break;
+    case MachineOperand::MO_RegisterMask:
+      // Ignore call clobbers.
+      continue;
     }
     
     OutMI.addOperand(MCOp);