RedundantReloadRemover participates in the state-recycling machinery implemented in cranelift-codegen/src/context.rs, whose goal it is to cache per-pass state so it can be used for compilation of multiple functions without reallocation. Unfortunately RedundantReloadRemover::run simply ignores the cached state and reallocates it new for each function. This patch fixes that. This reduces the number of malloc'd blocks by about 2%.
This crate contains the core Cranelift code generator. It translates code from an intermediate representation into executable machine code.