Turn a few more inline asm errors into "emitErrors" instead of fatal errors.
[oota-llvm.git] / lib / CodeGen / ExpandPostRAPseudos.cpp
index 623b67ddcd67a0481db35a53932e7c63a61a6110..3d23db0b8fbf10a19d3e1f7bc7f0ff73f1aa3f6f 100644 (file)
@@ -205,6 +205,18 @@ bool ExpandPostRA::runOnMachineFunction(MachineFunction &MF) {
       MachineInstr *MI = mi;
       // Advance iterator here because MI may be erased.
       ++mi;
+
+      // Only expand pseudos.
+      if (!MI->isPseudo())
+        continue;
+
+      // Give targets a chance to expand even standard pseudos.
+      if (TII->expandPostRAPseudo(MI)) {
+        MadeChange = true;
+        continue;
+      }
+
+      // Expand standard pseudos.
       switch (MI->getOpcode()) {
       case TargetOpcode::SUBREG_TO_REG:
         MadeChange |= LowerSubregToReg(MI);
@@ -217,10 +229,6 @@ bool ExpandPostRA::runOnMachineFunction(MachineFunction &MF) {
       case TargetOpcode::INSERT_SUBREG:
       case TargetOpcode::EXTRACT_SUBREG:
         llvm_unreachable("Sub-register pseudos should have been eliminated.");
-      default:
-        if (MI->getDesc().isPseudo())
-          MadeChange |= TII->expandPostRAPseudo(MI);
-        break;
       }
     }
   }