This is an archive of the discontinued LLVM Phabricator instance.

[NFC][Debug] Fix unnecessary deep-copy for vector to save compiling time
ClosedPublic

Authored by steven.zhang on Apr 8 2021, 9:02 PM.

Details

Summary

We saw some big compiling time impact after enabling the debug entry value feature for X86 platform(D73534). Compiling time goes from 900s->1600s with our testcase. It is caused by allocating/freeing the memory busily.

using FwdRegWorklist = MapVector<unsigned, SmallVector<FwdRegParamInfo, 2>>;

The value for this map vector is vector, and we miss the reference when access the element. The same happens for `auto CalleesMap = MF->getCallSitesInfo();` which is a DenseMap.

Diff Detail

Event Timeline

steven.zhang created this revision.Apr 8 2021, 9:02 PM
steven.zhang requested review of this revision.Apr 8 2021, 9:02 PM
Herald added a project: Restricted Project. · View Herald TranscriptApr 8 2021, 9:02 PM
MTC added a subscriber: MTC.Apr 8 2021, 9:05 PM
steven.zhang retitled this revision from [Debug] Fix unnecessary deep-copy for vecto to save compiling time to [NFC][Debug] Fix unnecessary deep-copy for vector to save compiling time .Apr 8 2021, 10:00 PM
flychen50 accepted this revision.Apr 11 2021, 2:18 AM
This revision is now accepted and ready to land.Apr 11 2021, 2:18 AM

Hi, @djtodoro, do you have any concern on this ? If not, I will land this patch days later.

djtodoro accepted this revision.Apr 11 2021, 11:15 PM

Does this solve the problem?

Does this solve the problem?

Yes.

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