Alias analysis: refactor for use by other driver loops. (#5380)
* Alias analysis: refactor for use by other driver loops. This PR pulls the core of the alias analysis infrastructure into a `process_inst()` method that operates on a single instruction, and allows another compiler pass to apply store-to-load forwarding and redundant-load elimination interleaved with other work. The existing behavior remains unchanged; the pass's toplevel loop calls this extracted method. This refactor is a prerequisite for using the alias analysis as part of a refactored egraph-based optimization framework. * Review feedback: remove unneeded mut.
This commit is contained in:
@@ -365,8 +365,8 @@ impl Context {
|
||||
/// by a store instruction to the same instruction (so-called
|
||||
/// "store-to-load forwarding").
|
||||
pub fn replace_redundant_loads(&mut self) -> CodegenResult<()> {
|
||||
let mut analysis = AliasAnalysis::new(&mut self.func, &self.domtree);
|
||||
analysis.compute_and_update_aliases();
|
||||
let mut analysis = AliasAnalysis::new(&self.func, &self.domtree);
|
||||
analysis.compute_and_update_aliases(&mut self.func);
|
||||
Ok(())
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user