[llvm] a623051 - [TableGen] Replace two SmallDenseSets with SmallSets.

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 16 17:58:07 PDT 2021


Author: Craig Topper
Date: 2021-04-16T17:57:53-07:00
New Revision: a623051dc3011fe6f41bddab4024fc213f60282b

URL: https://github.com/llvm/llvm-project/commit/a623051dc3011fe6f41bddab4024fc213f60282b
DIFF: https://github.com/llvm/llvm-project/commit/a623051dc3011fe6f41bddab4024fc213f60282b.diff

LOG: [TableGen] Replace two SmallDenseSets with SmallSets.

The key here is HwMode indices. They're going to be small numbers,
contiguous, and only a few different values. I don't think we need
to go through the SmallDenseSet hashing.

A BitVector would be even better, but we don't have the upper
bound here.

Added: 
    

Modified: 
    llvm/utils/TableGen/CodeGenDAGPatterns.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/utils/TableGen/CodeGenDAGPatterns.cpp b/llvm/utils/TableGen/CodeGenDAGPatterns.cpp
index 43486880933c..4ab2f1c69911 100644
--- a/llvm/utils/TableGen/CodeGenDAGPatterns.cpp
+++ b/llvm/utils/TableGen/CodeGenDAGPatterns.cpp
@@ -111,7 +111,7 @@ bool TypeSetByHwMode::insert(const ValueTypeByHwMode &VVT) {
   bool ContainsDefault = false;
   MVT DT = MVT::Other;
 
-  SmallDenseSet<unsigned, 4> Modes;
+  SmallSet<unsigned, 4> Modes;
   for (const auto &P : VVT) {
     unsigned M = P.first;
     Modes.insert(M);
@@ -224,7 +224,7 @@ bool TypeSetByHwMode::operator==(const TypeSetByHwMode &VTS) const {
   if (HaveDefault != VTSHaveDefault)
     return false;
 
-  SmallDenseSet<unsigned, 4> Modes;
+  SmallSet<unsigned, 4> Modes;
   for (auto &I : *this)
     Modes.insert(I.first);
   for (const auto &I : VTS)


        


More information about the llvm-commits mailing list