pub struct CacheOptPass {
pub config: CacheOptConfig,
pub report: CacheOptReport,
}Expand description
The top-level cache-aware / data-locality optimization pass.
Usage:
use oxilean_codegen::opt_cache::{CacheOptConfig, CacheOptPass};
let mut pass = CacheOptPass::new(CacheOptConfig::default());
// pass.run(&mut decls);Fields§
§config: CacheOptConfigConfiguration for this pass.
report: CacheOptReportAccumulated report from the last run call.
Implementations§
Source§impl CacheOptPass
impl CacheOptPass
Sourcepub fn new(config: CacheOptConfig) -> Self
pub fn new(config: CacheOptConfig) -> Self
Creates a new CacheOptPass with the given configuration.
Sourcepub fn run(&mut self, decls: &mut [LcnfFunDecl])
pub fn run(&mut self, decls: &mut [LcnfFunDecl])
Runs all cache optimizations over the provided function declarations.
Sourcepub fn analyze_locality(&self, decl: &LcnfFunDecl) -> DataLocalityInfo
pub fn analyze_locality(&self, decl: &LcnfFunDecl) -> DataLocalityInfo
Analyses data locality for a single function declaration.
Sourcepub fn apply_loop_tiling(&self, decl: &mut LcnfFunDecl, tiles: &[LoopTile])
pub fn apply_loop_tiling(&self, decl: &mut LcnfFunDecl, tiles: &[LoopTile])
Applies loop tiling annotations to a function declaration.
In the LCNF IR there are no explicit loop constructs, so this pass
records the tiling decision metadata for downstream backends to act on.
The body is traversed and Proj accesses on tiled variables are
annotated via a comment in the surrounding let binding name hint.
Sourcepub fn reorder_data_structures(&self, decl: &mut LcnfFunDecl)
pub fn reorder_data_structures(&self, decl: &mut LcnfFunDecl)
Reorders struct fields for improved spatial locality.
Uses FieldReorderingAnalysis to collect layout information, then
records the reordering decision as metadata on the declaration.