Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Dominators] Avoid potentially quadratic std::is_permutation
Summary: If the two sequences are not equal, std::is_permutation may be O(N^2) and indeed the case in libstdc++ and libc++. Use SmallPtrSet to prevent pessimizing cases. On my machine, SmallPtrSet starts to outperform std::is_permutation when there are 16 elements. Reviewers: kuhar Reviewed By: kuhar Subscribers: kristina, jdoerfert, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D58373 llvm-svn: 355070
- Loading branch information
Showing
1 changed file
with
14 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters