This is an archive of the discontinued LLVM Phabricator instance.

[MCA] Avoid an InstrDesc copy in mca::LSUnit::reserve.
ClosedPublic

Authored by orodley on Jul 24 2018, 9:31 PM.

Details

Summary

InstrDesc contains 4 vectors (as well as some other data), so it's
expensive to copy.

Diff Detail

Repository
rL LLVM

Event Timeline

orodley created this revision.Jul 24 2018, 9:31 PM
orodley created this object with visibility "orodley (Owen Rodley)".
orodley retitled this revision from Avoid an InstrDesc copy in mca::LSUnit::reserve. to [MCA] Avoid an InstrDesc copy in mca::LSUnit::reserve..
orodley changed the visibility from "orodley (Owen Rodley)" to "Public (No Login Required)".Jul 24 2018, 9:37 PM
mattd accepted this revision.Jul 25 2018, 9:42 AM
mattd added a reviewer: mattd.

Thanks for the patch @orodley. Good catch! LGTM.

This revision is now accepted and ready to land.Jul 25 2018, 9:43 AM

Thanks for the review.

mattd added a comment.Jul 25 2018, 4:42 PM

@orodley No problem. I don't know if you have commit access (your account looks pretty new), but I'm happy to land the patch for you later if you wish.

dberris accepted this revision.Jul 25 2018, 4:57 PM
dberris added a subscriber: dberris.

LGTM, I'll land for @orodley until he gets llvm commit access.

@mattd Dean's in my time zone so I asked him before I saw your comment, but thanks for the offer.

This revision was automatically updated to reflect the committed changes.
mattd added a comment.Jul 25 2018, 5:07 PM

@mattd Dean's in my time zone so I asked him before I saw your comment, but thanks for the offer.

Awesome. Thanks for looking into this! I'm curious, did you discover this through some performance measuring, or did it just catch your eye when reading over the source?

@mattd

Yep, it was through profiling. I've been working on a new scheduler using MCA, as Clement alluded to in https://bugs.llvm.org/show_bug.cgi?id=37696.
mca::Pipeline::run ends up being the hot part, and this was a simple, easily upstreamable 5% improvement within that :)

mattd added a comment.Jul 25 2018, 5:26 PM

@mattd

Yep, it was through profiling. I've been working on a new scheduler using MCA, as Clement alluded to in https://bugs.llvm.org/show_bug.cgi?id=37696.
mca::Pipeline::run ends up being the hot part, and this was a simple, easily upstreamable 5% improvement within that :)

Thanks!