This is an archive of the discontinued LLVM Phabricator instance.

[X86][Sched] Fix WriteZero sched class for all CPUs.
AbandonedPublic

Authored by courbet on May 25 2018, 8:50 AM.

Details

Summary

Because the default latency and #uops are 1 in a WriteRes, they were
wrong for WriteZero.

Diff Detail

Event Timeline

courbet created this revision.May 25 2018, 8:50 AM

TBH, WriteZero really isn't fit for purpose - its trying to do too much, and with a bit of luck we might be able to get rid of most of it:

FLD1/FLDZ (write f80 constants) seem to always use a resource of some kind - I haven't investigated too much into how they should be tagged although a quick glance at Agner suggests they reasonably match CVTPI2PD (so maybe retag them as WriteCvtI2PD?), or maybe create a WriteF80Constant class - same for the other x87 constants - FLDPI/FLDLG2/FLDL2E/FLDL2T/FLDLN2 as they typically are all the same (although incorrectly set to WriteMicrocoded by the looks of the tests).

The xmm/ymm/gpr zero idioms will hopefully be handled by variants (see D47374 which gets more of this in place) - not sure what to do with the zero psuedo instructions, maybe keep WriteZero just for them (or move into WriteNOP)?

The remaining cases (CLC etc.) might almost be better off using WriteNOP, or a target specific equivalent.

RKSimon added inline comments.May 30 2018, 6:03 AM
lib/Target/X86/X86SchedBroadwell.td
159

You can make all of these tidier by using the X86WriteRes multiclass:

defm : X86WriteRes<WriteZero, [], 0, [], 0>;
test/CodeGen/X86/avx512-intrinsics-upgrade.ll
2

General intrinsics/combines tests shouldn't typically be dependent on a specific cpu model - it causes superfluous changes like these - I'll fix the tests shortly.

utils/TableGen/GlobalISelEmitter.cpp
1987

Should this be here?

@courbet What's the plan for this phab?

Oops, sorry. I'm dropping this. I've started splitting it into several sub-commits. Thanks for the recommandations !

courbet abandoned this revision.Jun 15 2018, 7:48 AM