1
Fork 0

Use sparse representation of switch sources

to avoid quadratic space overhead
This commit is contained in:
Tomasz Miąsko 2022-05-08 00:00:00 +00:00
parent fbc3cc18be
commit 2be012a0c6
3 changed files with 8 additions and 10 deletions

View file

@ -322,7 +322,7 @@ where
fn apply(&mut self, mut apply_edge_effect: impl FnMut(&mut D, SwitchIntTarget)) {
assert!(!self.effects_applied);
let values = &self.body.switch_sources()[self.bb][self.pred];
let values = &self.body.switch_sources()[&(self.bb, self.pred)];
let targets = values.iter().map(|&value| SwitchIntTarget { value, target: self.bb });
let mut tmp = None;