OSDN Git Service

[X86] Don't add stores to the autogenerated load folding tables if the register and...
authorCraig Topper <craig.topper@intel.com>
Tue, 12 Jun 2018 07:32:18 +0000 (07:32 +0000)
committerCraig Topper <craig.topper@intel.com>
Tue, 12 Jun 2018 07:32:18 +0000 (07:32 +0000)
This can cause the amount of the memory written to be changed which would be bad.

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

utils/TableGen/X86FoldTablesEmitter.cpp

index 6ef339b..190ad6c 100644 (file)
@@ -562,7 +562,8 @@ void X86FoldTablesEmitter::updateTables(const CodeGenInstruction *RegInstr,
     //   MOVAPSmr => (outs), (ins f128mem:$dst, VR128:$src)
     Record *RegOpRec = RegInstr->Operands[RegOutSize - 1].Rec;
     Record *MemOpRec = MemInstr->Operands[RegOutSize - 1].Rec;
-    if (isRegisterOperand(RegOpRec) && isMemoryOperand(MemOpRec))
+    if (isRegisterOperand(RegOpRec) && isMemoryOperand(MemOpRec) &&
+        getRegOperandSize(RegOpRec) == getMemOperandSize(MemOpRec))
       addEntryWithFlags(Table0, RegInstr, MemInstr, S, 0);
   }