]> granicus.if.org Git - llvm/commitdiff
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.

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

lib/Target/AArch64/AArch64ExpandPseudoInsts.cpp

index d4d291066cafc8a9fbf7af950a3c87f0b92ce3f2..fdb90f40aa82496777ff511dd664d310320e8d7a 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;
 }