Skip to content

Commit

Permalink
[X86][SLM] RMW instructions don't require an extra uop
Browse files Browse the repository at this point in the history
For RMW instructions, the load and store hold the MEC for an extra cycle, but within the same single uop. This is alluded to in the Intel AOM:

"The MEC also owns the MEC RSV, which is responsible for scheduling of all loads and stores. Load and
store instructions go through addresses generation phase in program order to avoid on-the-fly memory
ordering later in the pipeline. Therefore, an unknown address will stall younger memory instructions."

Noticed while trying to get a cheap SLM test box up and running with llvm-exegesis - RMW arithmetic is always 1uop - and matches what Agner / InstLatX64 report as well.
  • Loading branch information
RKSimon committed Sep 4, 2021
1 parent da965a7 commit c637102
Show file tree
Hide file tree
Showing 2 changed files with 341 additions and 341 deletions.
6 changes: 3 additions & 3 deletions llvm/lib/Target/X86/X86ScheduleSLM.td
Expand Up @@ -79,9 +79,9 @@ multiclass SLMWriteResPair<X86FoldableSchedWrite SchedRW,
}
}

// A folded store needs a cycle on MEC_RSV for the store data, but it does not
// need an extra port cycle to recompute the address.
def : WriteRes<WriteRMW, [SLM_MEC_RSV]>;
// A folded store needs a cycle on MEC_RSV for the store data (using the same uop),
// but it does not need an extra port cycle to recompute the address.
def : WriteRes<WriteRMW, [SLM_MEC_RSV]> { let NumMicroOps = 0; }

def : WriteRes<WriteStore, [SLM_IEC_RSV01, SLM_MEC_RSV]>;
def : WriteRes<WriteStoreNT, [SLM_IEC_RSV01, SLM_MEC_RSV]>;
Expand Down

0 comments on commit c637102

Please sign in to comment.