diff options
| author | Michael Zolotukhin <mzolotukhin@apple.com> | 2017-10-17 23:47:06 +0000 |
|---|---|---|
| committer | Michael Zolotukhin <mzolotukhin@apple.com> | 2017-10-17 23:47:06 +0000 |
| commit | c4fcc189d2f7e8bfdab0d8da576ff6ce0adb1d23 (patch) | |
| tree | 98ff97ec3a42c9ae3f54449e23406fc325ac9b36 /llvm/include | |
| parent | c03ceb92ca601adb1dd11a957e77dc5782b25216 (diff) | |
| download | bcm5719-llvm-c4fcc189d2f7e8bfdab0d8da576ff6ce0adb1d23.tar.gz bcm5719-llvm-c4fcc189d2f7e8bfdab0d8da576ff6ce0adb1d23.zip | |
[GlobalDCE] Use DenseMap instead of unordered_multimap for GVDependencies.
Summary:
std::unordered_multimap happens to be very slow when the number of elements
grows large. On one of our internal applications we observed a 17x compile time
improvement from changing it to DenseMap.
Reviewers: mehdi_amini, serge-sans-paille, davide
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D38916
llvm-svn: 316045
Diffstat (limited to 'llvm/include')
| -rw-r--r-- | llvm/include/llvm/Transforms/IPO/GlobalDCE.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/include/llvm/Transforms/IPO/GlobalDCE.h b/llvm/include/llvm/Transforms/IPO/GlobalDCE.h index 9ca939c15b6..7ca241f4645 100644 --- a/llvm/include/llvm/Transforms/IPO/GlobalDCE.h +++ b/llvm/include/llvm/Transforms/IPO/GlobalDCE.h @@ -35,7 +35,7 @@ private: SmallPtrSet<GlobalValue*, 32> AliveGlobals; /// Global -> Global that uses this global. - std::unordered_multimap<GlobalValue *, GlobalValue *> GVDependencies; + DenseMap<GlobalValue *, SmallPtrSet<GlobalValue *, 4>> GVDependencies; /// Constant -> Globals that use this global cache. std::unordered_map<Constant *, SmallPtrSet<GlobalValue *, 8>> |

