[RegAllocFast] Use uint16_t SparseT for LiveRegMap
authorAlexis Engelke <engelke@in.tum.de>
Wed, 26 Apr 2023 14:26:42 +0000 (16:26 +0200)
committerAlexis Engelke <engelke@in.tum.de>
Thu, 27 Apr 2023 16:58:49 +0000 (18:58 +0200)
For functions with very large numbers of live variables, lookups into
LiveRegMap previously detoriated to linear searches.

This slightly increases memory usage, but that is barely measurable.

Reviewed By: arsenm

Differential Revision: https://reviews.llvm.org/D149330

llvm/lib/CodeGen/RegAllocFast.cpp

index f60e176..17df5d6 100644 (file)
@@ -106,7 +106,7 @@ namespace {
       }
     };
 
-    using LiveRegMap = SparseSet<LiveReg>;
+    using LiveRegMap = SparseSet<LiveReg, identity<unsigned>, uint16_t>;
     /// This map contains entries for each virtual register that is currently
     /// available in a physical register.
     LiveRegMap LiveVirtRegs;