[X86][SLM] RMW instructions don't require an extra uop
authorSimon Pilgrim <llvm-dev@redking.me.uk>
Sat, 4 Sep 2021 11:57:15 +0000 (12:57 +0100)
committerSimon Pilgrim <llvm-dev@redking.me.uk>
Sat, 4 Sep 2021 12:21:34 +0000 (13:21 +0100)
commitc6371020a801f1da327ec3dcdfa0818fbd6f657a
treeaf5594fc0096602dbcc1abaa10c004158036e857
parentda965a77d566b9295a5928ca4c989650131bfc0b
[X86][SLM] RMW instructions don't require an extra uop

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.
llvm/lib/Target/X86/X86ScheduleSLM.td
llvm/test/tools/llvm-mca/X86/SLM/resources-x86_64.s