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

Repository
rL LLVM

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 ↗(On Diff #120037)

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
550 ↗(On Diff #120211)

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

589 ↗(On Diff #120211)

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")>;
595 ↗(On Diff #120211)

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")>;
604 ↗(On Diff #120211)

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

612 ↗(On Diff #120211)

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

614 ↗(On Diff #120211)

Add VPTESTYrr as well

618 ↗(On Diff #120211)

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

620 ↗(On Diff #120211)

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
552 ↗(On Diff #120821)

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
552 ↗(On Diff #120821)

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.