Skip to content

Commit 779e19d

Browse files
committed
Auto merge of #147644 - cjgillot:bitsetvec, r=jackh726
Use regular Vec in BitSet. That code is hot enough for the branch in all accesses to `SmallVec` to appear in profiles.
2 parents f524236 + 0432322 commit 779e19d

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

compiler/rustc_index/src/bit_set.rs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ use std::{fmt, iter, slice};
88
use Chunk::*;
99
#[cfg(feature = "nightly")]
1010
use rustc_macros::{Decodable_NoContext, Encodable_NoContext};
11-
use smallvec::{SmallVec, smallvec};
1211

1312
use crate::{Idx, IndexVec};
1413

@@ -118,7 +117,7 @@ macro_rules! bit_relations_inherent_impls {
118117
#[derive(Eq, PartialEq, Hash)]
119118
pub struct DenseBitSet<T> {
120119
domain_size: usize,
121-
words: SmallVec<[Word; 2]>,
120+
words: Vec<Word>,
122121
marker: PhantomData<T>,
123122
}
124123

@@ -134,15 +133,15 @@ impl<T: Idx> DenseBitSet<T> {
134133
#[inline]
135134
pub fn new_empty(domain_size: usize) -> DenseBitSet<T> {
136135
let num_words = num_words(domain_size);
137-
DenseBitSet { domain_size, words: smallvec![0; num_words], marker: PhantomData }
136+
DenseBitSet { domain_size, words: vec![0; num_words], marker: PhantomData }
138137
}
139138

140139
/// Creates a new, filled bitset with a given `domain_size`.
141140
#[inline]
142141
pub fn new_filled(domain_size: usize) -> DenseBitSet<T> {
143142
let num_words = num_words(domain_size);
144143
let mut result =
145-
DenseBitSet { domain_size, words: smallvec![!0; num_words], marker: PhantomData };
144+
DenseBitSet { domain_size, words: vec![!0; num_words], marker: PhantomData };
146145
result.clear_excess_bits();
147146
result
148147
}
@@ -1384,7 +1383,7 @@ impl<T: Idx> From<DenseBitSet<T>> for GrowableBitSet<T> {
13841383
pub struct BitMatrix<R: Idx, C: Idx> {
13851384
num_rows: usize,
13861385
num_columns: usize,
1387-
words: SmallVec<[Word; 2]>,
1386+
words: Vec<Word>,
13881387
marker: PhantomData<(R, C)>,
13891388
}
13901389

@@ -1397,7 +1396,7 @@ impl<R: Idx, C: Idx> BitMatrix<R, C> {
13971396
BitMatrix {
13981397
num_rows,
13991398
num_columns,
1400-
words: smallvec![0; num_rows * words_per_row],
1399+
words: vec![0; num_rows * words_per_row],
14011400
marker: PhantomData,
14021401
}
14031402
}

0 commit comments

Comments
 (0)