Skip to content

Commit 8def128

Browse files
authored
[UniformityAnalysis] Use DenseSet for DivergentValues (llvm#93455)
Values are small, and std::set is just unnecessarily expensive. It stood out in some quick performance profiling. DenseSet is a better alternative in this case.
1 parent 1e6a82b commit 8def128

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

llvm/include/llvm/ADT/GenericUniformityImpl.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,14 +46,13 @@
4646

4747
#include "llvm/ADT/GenericUniformityInfo.h"
4848

49+
#include "llvm/ADT/DenseSet.h"
4950
#include "llvm/ADT/STLExtras.h"
5051
#include "llvm/ADT/SmallPtrSet.h"
5152
#include "llvm/ADT/SparseBitVector.h"
5253
#include "llvm/ADT/StringExtras.h"
5354
#include "llvm/Support/raw_ostream.h"
5455

55-
#include <set>
56-
5756
#define DEBUG_TYPE "uniformity"
5857

5958
namespace llvm {
@@ -413,7 +412,7 @@ template <typename ContextT> class GenericUniformityAnalysisImpl {
413412
const TargetTransformInfo *TTI = nullptr;
414413

415414
// Detected/marked divergent values.
416-
std::set<ConstValueRefT> DivergentValues;
415+
DenseSet<ConstValueRefT> DivergentValues;
417416
SmallPtrSet<const BlockT *, 32> DivergentTermBlocks;
418417

419418
// Internal worklist for divergence propagation.

0 commit comments

Comments
 (0)