[llvm] r334480 - [X86] Don't add stores to the autogenerated load folding tables if the register and memory operands have different widths.

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 12 00:32:18 PDT 2018


Author: ctopper
Date: Tue Jun 12 00:32:18 2018
New Revision: 334480

URL: http://llvm.org/viewvc/llvm-project?rev=334480&view=rev
Log:
[X86] Don't add stores to the autogenerated load folding tables if the register and memory operands have different widths.

This can cause the amount of the memory written to be changed which would be bad.

Modified:
    llvm/trunk/utils/TableGen/X86FoldTablesEmitter.cpp

Modified: llvm/trunk/utils/TableGen/X86FoldTablesEmitter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/X86FoldTablesEmitter.cpp?rev=334480&r1=334479&r2=334480&view=diff
==============================================================================
--- llvm/trunk/utils/TableGen/X86FoldTablesEmitter.cpp (original)
+++ llvm/trunk/utils/TableGen/X86FoldTablesEmitter.cpp Tue Jun 12 00:32:18 2018
@@ -562,7 +562,8 @@ void X86FoldTablesEmitter::updateTables(
     //   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);
   }
 




More information about the llvm-commits mailing list