This is an archive of the discontinued LLVM Phabricator instance.

[X86] Add BTVER2 sched support for SHLD/SHRD
ClosedPublic

Authored by avt77 on Nov 16 2017, 5:26 AM.

Details

Summary

This patch is the first step to implement proper usage of SHLD/SHRD on Machine Combiner level. At first the patch introduces proper sched model for these 2 instructions. And at second the patch adds new schedule test specially for SHLD/SHRD.

In the next patch I'm going to introduce the selection of the best code sequence (SHLD/SHRD or alternative) based on [latency:throughput] numbers.

Diff Detail

Repository
rL LLVM

Event Timeline

avt77 created this revision.Nov 16 2017, 5:26 AM
RKSimon edited edge metadata.Nov 16 2017, 6:51 AM

Please split off the SHLD/SHRD and MOV changes into two separate patches - the RET chang is far too noisy to see anything else.

avt77 updated this revision to Diff 123305.Nov 17 2017, 1:42 AM
avt77 retitled this revision from A new sched model for SHLD/SHRD, MOV and RET on btver2 to A new sched model for SHLD/SHRD.
avt77 edited the summary of this revision. (Show Details)

Only SHLD/SHRD related changes were left inside the patch.

schedule-x86-64-shld.ll is superfluous - please remove it

avt77 added a comment.Nov 17 2017, 3:01 AM

schedule-x86-64-shld.ll is superfluous - please remove it

In fact I use it to show and check code patterns:

shldrri <-> shl+shr+lea

or

shldrrCL <-> mov+shr+mov+sub+....

I was planning to extend it with other possible variants.
Of course if you insist I could keep it localy but from my point of view the test could be useful for others. I could remove several RUN lines and leave one or two of them only if you'd like.
Should I remove/update the test?

avt77 updated this revision to Diff 123886.Nov 22 2017, 1:52 AM

I removed schedule-x86-64-shld.ll.

RKSimon added inline comments.Nov 22 2017, 7:27 AM
lib/Target/X86/X86ScheduleBtVer2.td
154 ↗(On Diff #123886)

Better call this WriteSHLDm - as its a RW - also add the JLAGU dependency

Also, the subject should be something like: "[X86] Add BTVER2 sched support for SHLD/SHRD"

avt77 updated this revision to Diff 124048.Nov 23 2017, 1:51 AM
avt77 retitled this revision from A new sched model for SHLD/SHRD to [X86] Add BTVER2 sched support for SHLD/SHRD.

Last Simon's comments were fixed.

RKSimon accepted this revision.Nov 24 2017, 6:25 AM

LGTM

This revision is now accepted and ready to land.Nov 24 2017, 6:25 AM
This revision was automatically updated to reflect the committed changes.