reduce sparseset memory requirement
authorRichard Biener <rguenther@suse.de>
Tue, 9 Feb 2021 10:50:23 +0000 (11:50 +0100)
committerRichard Biener <rguenther@suse.de>
Thu, 11 Feb 2021 11:46:34 +0000 (12:46 +0100)
Currently we use HOST_WIDEST_FAST_INT for the sparseset element
type which maps to a 64bit type on 64bit hosts.  That's excessive
for the only current sparseset users which are LRA and IRA and
which store register numbers in it which are unsigned int.  The
following changes the sparseset element type to unsigned int.

2021-02-09  Richard Biener  <rguenther@suse.de>

* sparseset.h (SPARSESET_ELT_BITS): Remove.
(SPARSESET_ELT_TYPE): Use unsigned int.
* fwprop.c: Do not include sparseset.h.

gcc/fwprop.c
gcc/sparseset.h

index 123cc22..4b8a554 100644 (file)
@@ -28,7 +28,6 @@ along with GCC; see the file COPYING3.  If not see
 #include "df.h"
 #include "rtl-ssa.h"
 
-#include "sparseset.h"
 #include "predict.h"
 #include "cfgrtl.h"
 #include "cfgcleanup.h"
index c72b4fe..017884e 100644 (file)
@@ -76,15 +76,14 @@ along with GCC; see the file COPYING3.  If not see
    Sparse sets storage requirements are relatively large: O(U) with a
    larger constant than sbitmaps (if the storage requirement for an
    sbitmap with universe U is S, then the storage required for a sparse
-   set for the same universe are 2*HOST_BITS_PER_WIDEST_FAST_INT * S).
+   set for the same universe are 2 * sizeof (SPARSESET_ELT_TYPE) * 8 * S).
    Accessing the sparse vector is not very cache-friendly, but iterating
    over the members in the set is cache-friendly because only the dense
    vector is used.  */
 
 /* Data Structure used for the SparseSet representation.  */
 
-#define SPARSESET_ELT_BITS ((unsigned) HOST_BITS_PER_WIDEST_FAST_INT)
-#define SPARSESET_ELT_TYPE unsigned HOST_WIDEST_FAST_INT
+#define SPARSESET_ELT_TYPE unsigned int
 
 typedef struct sparseset_def
 {