1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2025-02-01 13:11:39 +01:00

[X86] Update folding table generator to properly detect RMW arithmetic instructions.

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.

llvm-svn: 334478
This commit is contained in:
Craig Topper 2018-06-12 07:32:15 +00:00
parent f54428be08
commit 01a2362d18

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