This is an archive of the discontinued LLVM Phabricator instance.

[IRSimilarity] Strip out the findSimilarity call from the constructor
ClosedPublic

Authored by lanza on Dec 2 2020, 4:38 PM.

Details

Summary

Both doInitialize and runOnModule were running the entire analysis
due to the actual work being done in the constructor. Strip it out here
and only get the similarity during runOnModule.

Diff Detail

Event Timeline

lanza created this revision.Dec 2 2020, 4:38 PM
Herald added a project: Restricted Project. · View Herald TranscriptDec 2 2020, 4:38 PM
lanza requested review of this revision.Dec 2 2020, 4:38 PM
lanza added a reviewer: plotfi.Dec 2 2020, 5:27 PM
lanza removed a reviewer: zer0.
AndrewLitteken added a comment.EditedDec 2 2020, 8:27 PM

I don't think anything in future patches uses the constructor either so should be ok.

Besides the comment, this looks fine to me, but I would like one of the other reviewers to look at it since I'm still fairly new to LLVM developer community.

llvm/lib/Analysis/IRSimilarityIdentifier.cpp
664

We can get rid of/change this comment now.

AndrewLitteken accepted this revision.Jan 20 2021, 6:51 PM

With the nit about the comment this LGTM

This revision is now accepted and ready to land.Jan 20 2021, 6:51 PM

If there are no objections, can I merge this on behalf of @lanza?

This revision was landed with ongoing or failed builds.Jun 11 2021, 4:41 PM
This revision was automatically updated to reflect the committed changes.