This is an archive of the discontinued LLVM Phabricator instance.

Minor performance tweaks to llvm-tblgen (and a few that might be a good idea)
ClosedPublic

Authored by rnk on Feb 2 2016, 5:35 PM.

Details

Summary

This patch adds a reserve call to an expensive function (llvm::LoadIntrinsics), and may fix a few other low hanging performance fruit (I've put them in comments for now, so we can discuss).

Motivation:

As I'm sure other developers do, when I build LLVM, I build the entire project with the same config (Debug, MinSizeRel, Release, or RelWithDebInfo). However, the Debug config also builds llvm-tblgen in Debug mode. Later build steps that run llvm-tblgen then can actually be the slowest steps in the entire build. Nobody likes slow builds.

Diff Detail

Event Timeline

ariccio updated this revision to Diff 46726.Feb 2 2016, 5:35 PM
ariccio retitled this revision from to Minor performance tweaks to llvm-tblgen (and a few that might be a good idea).
ariccio updated this object.
ariccio added reviewers: rnk, qcolombet, craig.topper.
ariccio added a subscriber: llvm-commits.

(posted elaborative comments)

C:/LLVM/llvm/include/llvm/TableGen/Record.h
1312

This is more of a long term suggestion, as I'm not immediately sure how to modify this to eliminate the copy.

C:/LLVM/llvm/utils/TableGen/CodeGenTarget.cpp
451

rnk added this code ~8 days ago... any reason why you wrote it as a by-value lambda?

ariccio updated this revision to Diff 46740.Feb 2 2016, 9:58 PM

Responded to comments.

ariccio marked 2 inline comments as done.Feb 3 2016, 10:05 AM

Changes discussed on llvm-commits, changes implemented, comments marked as Done.

rnk accepted this revision.Feb 3 2016, 10:15 AM
rnk edited edge metadata.

lgtm, do you need someone to commit this?

C:/LLVM/llvm/include/llvm/TableGen/Record.h
1312

This should do the trick:

if (SCPair.first->getNameInit()->getValue() == Name)
This revision is now accepted and ready to land.Feb 3 2016, 10:15 AM
ariccio added a comment.EditedFeb 3 2016, 10:57 AM
In D16832#343220, @rnk wrote:

lgtm, do you need someone to commit this?

Yup, no privs.

Although, if SCPair.first->getNameInit()->getValue() returns the same string, maybe I should update the diff first?

C:/LLVM/llvm/include/llvm/TableGen/Record.h
1312

Does that return the equivalent string vs getAsUnquotedString?

Bump?

(I kinda wanna get this out of the way, I hope that's not too pushy!)

C:/LLVM/llvm/include/llvm/TableGen/Record.h
1312

Bump?

rnk commandeered this revision.Feb 8 2016, 2:09 PM
rnk edited reviewers, added: ariccio; removed: rnk.

This landed as r259683, but didn't autoclose because "Differential revision" wasn't the last line in the commit.

This revision now requires review to proceed.Feb 8 2016, 2:09 PM
rnk accepted this revision.Feb 8 2016, 2:10 PM
rnk added a reviewer: rnk.

marking accepted

This revision is now accepted and ready to land.Feb 8 2016, 2:10 PM
rnk closed this revision.Feb 8 2016, 2:10 PM

closing