[NFC][Debug] Fix unnecessary deep-copy for vector to save compiling time
authorZhang Qing Shan <zhangqingshan.zll@bytedance.com>
Mon, 12 Apr 2021 06:55:03 +0000 (14:55 +0800)
committerZhang Qing Shan <zhangqingshan.zll@bytedance.com>
Mon, 12 Apr 2021 06:55:03 +0000 (14:55 +0800)
commitd69c236e1d6b4705d3a0041f39bfe864638eb24e
treed922da0d56cf1d5d82b97bde71d883f858be0657
parent2dd22da965ffc1623421cb8163947d7e679ce187
[NFC][Debug] Fix unnecessary deep-copy for vector to save compiling time

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 is vector, and we miss the reference when access the
element. The same happens for `auto CalleesMap = MF->getCallSitesInfo();` which is a DenseMap.

Reviewed by: djtodoro, flychen50

Differential Revision: https://reviews.llvm.org/D100162
llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp