This is an archive of the discontinued LLVM Phabricator instance.

[X86][AVX] Update YMM version of instructions scheduling on btver2
ClosedPublic

Authored by avt77 on Oct 24 2017, 4:22 AM.

Details

Summary

The patch updates sched numbers for YMM AVX instrs such as VMOVx, VORx, VXOR, VPERMILx, VBROADCASTx, etc.

Diff Detail

Event Timeline

avt77 created this revision.Oct 24 2017, 4:22 AM
RKSimon added inline comments.Oct 24 2017, 2:31 PM
lib/Target/X86/X86ScheduleBtVer2.td
456

Don't include commented out code

avt77 updated this revision to Diff 120211.Oct 25 2017, 2:08 AM

Commented out code was removed.

RKSimon added inline comments.Oct 27 2017, 9:14 AM
lib/Target/X86/X86ScheduleBtVer2.td
454

Default latency = 1 - so remove and just leave ResourceCycles?

493

This is masked load, and we need 128 bit versions:

def WriteVMaskMovLd: SchedWriteRes<[JLAGU,JFPU01]> {
  let Latency = 6;
}
def : InstRW<[WriteVMaskMovLd], (instregex "VMASKMOVP(D|S)rm")>;

def WriteVMaskMovYLd: SchedWriteRes<[JLAGU,JFPU01]> {
  let Latency = 6;
  let ResourceCycles = [1,2];
}
def : InstRW<[WriteVMaskMovYLd], (instregex "VMASKMOVP(D|S)Yrm")>;
499

This is masked store, and we need 128 bit versions:

def WriteVMaskMovSt: SchedWriteRes<[JFPU01,JSAGU]> {
  let Latency = 6;
}
def : InstRW<[WriteVMaskMovSt], (instregex "VMASKMOVP(D|S)mr")>;

def WriteVMaskMovYSt: SchedWriteRes<[JFPU01,JSAGU]> {
  let Latency = 6;
  let ResourceCycles = [2,1];
}
def : InstRW<[WriteVMaskMovYSt], (instregex "VMASKMOVP(D|S)Ymr")>;
508

128-bit versions need fixing as well - they are Latency=3 too

516

Shouldn't this be [1,1]? (i.e. default - so remove?)

518

Add VPTESTYrr as well

522

Where did you get [1, 4, 2] from ? Shouldn't this be [1,2,2]?

524

VPTESTYrm as well

avt77 updated this revision to Diff 120821.Oct 30 2017, 7:41 AM

Some numbers were changed, some new instructions were added, some model changes were done accordingly to Simon requirements.

RKSimon added inline comments.Oct 30 2017, 3:12 PM
lib/Target/X86/X86ScheduleBtVer2.td
456

Drop this - AVX1 doesn't have rr broadcast instructions (just rm instructions)

avt77 added inline comments.Oct 31 2017, 5:49 AM
lib/Target/X86/X86ScheduleBtVer2.td
456

But X86 Instr Info has such commands: it means we should open the corresponding bug, rught?

avt77 updated this revision to Diff 120980.Oct 31 2017, 7:12 AM

I removed the faked AVX instr.

RKSimon accepted this revision.Nov 1 2017, 2:36 PM

LGTM - thank you

This revision is now accepted and ready to land.Nov 1 2017, 2:36 PM
This revision was automatically updated to reflect the committed changes.