This is an archive of the discontinued LLVM Phabricator instance.

[X86] Fix instruction's ports info which is ported from SKL in AlderlakeP model
Needs ReviewPublic

Authored by HaohaiWen on May 8 2023, 10:09 PM.

Details

Summary

AlderlakeP model is auto generated by D130897 using scheduling data from:
(priority in dsc order):

  1. Measured data in uops.info.
  2. GoldenCove instruction throughput and latency in intel doc.
  3. Existing SkylakeClientModel.

In step 3, some ports functionality has changed and new ports were
addedd from SKL to GLC so we need to map the port number. e.g. Map uop
using port 4 (store) in SKL to port 4,9 in GLC.
The previous port mapping machanism in D130897 didn't work and is fixed now.
Refresh this AlderlakeP model to update ports of instructions which
scheduling info are ported from SKL.

Diff Detail

Event Timeline

HaohaiWen created this revision.May 8 2023, 10:09 PM
Herald added a project: Restricted Project. · View Herald Transcript
HaohaiWen requested review of this revision.May 8 2023, 10:09 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 8 2023, 10:09 PM
LuoYuanke added inline comments.May 10 2023, 5:56 AM
llvm/lib/Target/X86/X86SchedAlderlakeP.td
527

Where are JMP and RET SchedWrite defined? Why the port change affect this code?

HaohaiWen added inline comments.May 10 2023, 7:08 AM
llvm/lib/Target/X86/X86SchedAlderlakeP.td
527

Before this patch:
JMP with folded mem uses ADLPWriteResGroup2.

def ADLPWriteResGroup2 : SchedWriteRes<[ADLPPort00_06, ADLPPort02_03_11]> {
  let Latency = 6;
  let NumMicroOps = 2;
}

After this patch:
JMP uses default WriteJumpLd:

defm : ADLPWriteResPair<WriteJump, [ADLPPort00_06], 1, [1]>;

This multiclass defined WriteJumpLd as port = ADLPPort00_06 + ADLPPort02_03_11, Lat = 1 + 5 = 6.
Same as previous one.

The reason why this code changed is some scheduling info of instructions ported from SKL use SKL store port (4) before this patch and is mapped to port(2,3,11) in this patch. This changes instructions group with same scheduling info thus the inferred code changed.