[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.

llvm-svn: 334480
This commit is contained in:
Craig Topper 2018-06-12 07:32:18 +00:00
parent 5799e4df75
commit 4cdb153dde
1 changed files with 2 additions and 1 deletions

View 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);
}