OSDN Git Service

[X86] Update folding table generator to properly detect RMW arithmetic instructions.
authorCraig Topper <craig.topper@intel.com>
Tue, 12 Jun 2018 07:32:15 +0000 (07:32 +0000)
committerCraig Topper <craig.topper@intel.com>
Tue, 12 Jun 2018 07:32:15 +0000 (07:32 +0000)
The RMW instructions are detected by reading the SchedRW data, but the RMW instructions have had their SchedRW changed in recent months. This broke the expectation.

We probably should fix this to use the mayLoad/mayStore flags if possible.

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

utils/TableGen/X86FoldTablesEmitter.cpp

index 1ebe9f9..6ef339b 100644 (file)
@@ -517,8 +517,10 @@ void X86FoldTablesEmitter::updateTables(const CodeGenInstruction *RegInstr,
 
   // Instructions which have the WriteRMW value (Read-Modify-Write) should be
   // added to Table2Addr.
-  if (hasDefInList(MemRec, "SchedRW", "WriteRMW") && MemOutSize != RegOutSize &&
-      MemInSize == RegInSize) {
+  if ((hasDefInList(MemRec, "SchedRW", "WriteRMW") ||
+       hasDefInList(MemRec, "SchedRW", "WriteADCRMW") ||
+       hasDefInList(MemRec, "SchedRW", "WriteALURMW")) &&
+       MemOutSize != RegOutSize && MemInSize == RegInSize) {
     addEntryWithFlags(Table2Addr, RegInstr, MemInstr, S, 0);
     return;
   }