Skip to content

Commit c2720aa

Browse files
committed
Adjust SwitchSources small vec size.
I did some rough measurements that show, if `SwitchSources` is instantiated, one entry only covers ~60% of cases but two entries covers ~96% of cases.
1 parent 427ac5c commit c2720aa

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

compiler/rustc_middle/src/mir/basic_blocks.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ type Predecessors = IndexVec<BasicBlock, SmallVec<[BasicBlock; 4]>>;
2424
// `BasicBlocks::switch_sources`, which is only called by backwards analyses
2525
// that do `SwitchInt` handling, and we don't have any of those, not even in
2626
// tests. See #95120 and #94576.
27-
type SwitchSources = FxHashMap<(BasicBlock, BasicBlock), SmallVec<[u128; 1]>>;
27+
type SwitchSources = FxHashMap<(BasicBlock, BasicBlock), SmallVec<[u128; 2]>>;
2828

2929
#[derive(Clone, Default, Debug)]
3030
struct Cache {

0 commit comments

Comments
 (0)