remove unused postorder CFG cache

This commit is contained in:
Rémy Rakic 2023-06-14 20:04:51 +00:00
parent 0b4b0869a7
commit f134101e69

View file

@ -26,7 +26,6 @@ struct Cache {
predecessors: OnceCell<Predecessors>,
switch_sources: OnceCell<SwitchSources>,
is_cyclic: OnceCell<bool>,
postorder: OnceCell<Vec<BasicBlock>>,
reverse_postorder: OnceCell<Vec<BasicBlock>>,
dominators: OnceCell<Dominators<BasicBlock>>,
}
@ -63,14 +62,6 @@ impl<'tcx> BasicBlocks<'tcx> {
})
}
/// Returns basic blocks in a postorder.
#[inline]
pub fn postorder(&self) -> &[BasicBlock] {
self.cache.postorder.get_or_init(|| {
Postorder::new(&self.basic_blocks, START_BLOCK).map(|(bb, _)| bb).collect()
})
}
/// Returns basic blocks in a reverse postorder.
#[inline]
pub fn reverse_postorder(&self) -> &[BasicBlock] {