[llvm] 1e74373 - [RegAllocFast] Use uint16_t SparseT for LiveRegMap

Alexis Engelke via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 27 09:58:55 PDT 2023


Author: Alexis Engelke
Date: 2023-04-27T18:58:49+02:00
New Revision: 1e743732e7879bed2f8cbc1a875569a3a5e147d8

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

LOG: [RegAllocFast] Use uint16_t SparseT for LiveRegMap

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

Added: 
    

Modified: 
    llvm/lib/CodeGen/RegAllocFast.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/CodeGen/RegAllocFast.cpp b/llvm/lib/CodeGen/RegAllocFast.cpp
index f60e17679f65..17df5d6db90b 100644
--- a/llvm/lib/CodeGen/RegAllocFast.cpp
+++ b/llvm/lib/CodeGen/RegAllocFast.cpp
@@ -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;


        


More information about the llvm-commits mailing list