[PATCH] D149330: [RegAllocFast] Use uint16_t SparseT for LiveRegMap

Alexis Engelke via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 27 02:58:10 PDT 2023


aengelke created this revision.
aengelke added reviewers: efriedma, LuoYuanke, arsenm.
Herald added subscribers: hiraditya, qcolombet, MatzeB.
Herald added a project: All.
aengelke requested review of this revision.
Herald added subscribers: llvm-commits, wdng.
Herald added a project: LLVM.

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.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D149330

Files:
  llvm/lib/CodeGen/RegAllocFast.cpp


Index: llvm/lib/CodeGen/RegAllocFast.cpp
===================================================================
--- llvm/lib/CodeGen/RegAllocFast.cpp
+++ llvm/lib/CodeGen/RegAllocFast.cpp
@@ -106,7 +106,7 @@
       }
     };
 
-    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;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D149330.517500.patch
Type: text/x-patch
Size: 494 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230427/9fc10ae3/attachment.bin>


More information about the llvm-commits mailing list