]> granicus.if.org Git - llvm/commit
InstrProf: Avoid linear search in a hot loop
authorJustin Bogner <mail@justinbogner.com>
Thu, 2 Oct 2014 17:14:18 +0000 (17:14 +0000)
committerJustin Bogner <mail@justinbogner.com>
Thu, 2 Oct 2014 17:14:18 +0000 (17:14 +0000)
commitd76512681efca0eb7ad04b4b4f9d3a5b16dbd2b1
treed11579d65844d176b08768cd667357b3c55e2c22
parentf3cd10bdc3f7778900b486d9afcbf5f3c7898e08
InstrProf: Avoid linear search in a hot loop

Every time we were adding or removing an expression when generating a
coverage mapping we were doing a linear search to try and deduplicate
the list. The indices in the list are important, so we can't just
replace it by a DenseMap entirely, but an auxilliary DenseMap for fast
lookup massively improves the performance issues I was seeing here.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@218892 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/ProfileData/CoverageMapping.h
lib/ProfileData/CoverageMapping.cpp