Revert "[AArch64] Simplify AES*Tied pseudo expansion (NFC)."
authorTim Northover <tnorthover@apple.com>
Thu, 3 Aug 2017 16:59:36 +0000 (16:59 +0000)
committerTim Northover <tnorthover@apple.com>
Thu, 3 Aug 2017 16:59:36 +0000 (16:59 +0000)
This reverts commit r309821.

My suggestion was wrong because it left the MachineOperands tied which
confused the verifier. Since there's no easy way to untie operands, the
original BuildMI solution is probably best.

llvm-svn: 309962

llvm/lib/Target/AArch64/AArch64ExpandPseudoInsts.cpp

index d4d2910..fdb90f4 100644 (file)
@@ -967,10 +967,17 @@ bool AArch64ExpandPseudo::expandMI(MachineBasicBlock &MBB,
     return expandCMP_SWAP_128(MBB, MBBI, NextMBBI);
 
   case AArch64::AESMCrrTied:
-  case AArch64::AESIMCrrTied:
-    MI.setDesc(TII->get(Opcode == AArch64::AESMCrrTied ? AArch64::AESMCrr :
-                                                         AArch64::AESIMCrr));
+  case AArch64::AESIMCrrTied: {
+    MachineInstrBuilder MIB =
+    BuildMI(MBB, MBBI, MI.getDebugLoc(),
+            TII->get(Opcode == AArch64::AESMCrrTied ? AArch64::AESMCrr :
+                                                      AArch64::AESIMCrr))
+      .add(MI.getOperand(0))
+      .add(MI.getOperand(1));
+    transferImpOps(MI, MIB, MIB);
+    MI.eraseFromParent();
     return true;
+   }
   }
   return false;
 }