[Utils] Avoid a hash table lookup in salvageDI, NFC
authorVedant Kumar <vsk@apple.com>
Thu, 22 Feb 2018 01:29:41 +0000 (01:29 +0000)
committerVedant Kumar <vsk@apple.com>
Thu, 22 Feb 2018 01:29:41 +0000 (01:29 +0000)
commit1ceabcf080b4e46681554a23273018b15576536c
tree5589faff72d7a92310b52fd65ab22a130b49cb8a
parent55b7e01116bf883c659b3ad2a16cc7c218b739fa
[Utils] Avoid a hash table lookup in salvageDI, NFC

According to the current coverage report salvageDebugInfo() is called
5.12 million times during testing and almost always returns early.

The early return depends on LocalAsMetadata::getIfExists returning null,
which involves a DenseMap lookup in an LLVMContextImpl. We can probably
speed this up by simply checking the IsUsedByMD bit in Value.

llvm-svn: 325738
llvm/lib/Transforms/Utils/Local.cpp