Struct BlockMergingPass
pub struct BlockMergingPass {
pub max_iterations: usize,
}Expand description
Built-in SSA optimization passes from the compiler module.
All generic SSA transformation passes: value propagation, control flow recovery, dead code elimination, strength reduction, loop optimization, and more. Pass that eliminates trampoline blocks and coalesces single-edge pairs.
Delegates to crate::passes::blockmerge::run. The iteration cap
controls how many fixpoint iterations the inner loop runs.
§Modification scope
ModificationScope::CfgModifying — can change block predecessors,
successors, and remove blocks.
Fields§
§max_iterations: usizeMaximum number of fixpoint iterations for the inner merge loop.
Implementations§
Source§impl BlockMergingPass
impl BlockMergingPass
Sourcepub fn new(max_iterations: usize) -> BlockMergingPass
pub fn new(max_iterations: usize) -> BlockMergingPass
Creates a new block-merging pass with the given iteration cap.
Trait Implementations§
Source§impl Clone for BlockMergingPass
impl Clone for BlockMergingPass
Source§fn clone(&self) -> BlockMergingPass
fn clone(&self) -> BlockMergingPass
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for BlockMergingPass
Source§impl Debug for BlockMergingPass
impl Debug for BlockMergingPass
Source§impl Default for BlockMergingPass
impl Default for BlockMergingPass
Source§fn default() -> BlockMergingPass
fn default() -> BlockMergingPass
Returns the “default value” for a type. Read more
Source§impl<T, H> SsaPass<T, H> for BlockMergingPass
impl<T, H> SsaPass<T, H> for BlockMergingPass
Source§fn description(&self) -> &'static str
fn description(&self) -> &'static str
Returns a human-readable description of the pass.
Source§fn repairs_ssa(&self) -> bool
fn repairs_ssa(&self) -> bool
Returns whether the pass performs its own SSA boundary repair. Read more
Source§fn run_on_method(
&self,
ssa: &mut SsaFunction<T>,
method: &<T as Target>::MethodRef,
host: &H,
) -> Result<bool, Error>
fn run_on_method( &self, ssa: &mut SsaFunction<T>, method: &<T as Target>::MethodRef, host: &H, ) -> Result<bool, Error>
Run the pass on a single method’s SSA. Read more
Source§fn should_run(&self, _method: &<T as Target>::MethodRef, _host: &H) -> bool
fn should_run(&self, _method: &<T as Target>::MethodRef, _host: &H) -> bool
Determines whether this pass should run on a specific method. Read more
Source§fn run_global(&self, _host: &H) -> Result<bool, Error>
fn run_global(&self, _host: &H) -> Result<bool, Error>
Run the pass on the entire program (interprocedural passes). Read more
Source§fn is_global(&self) -> bool
fn is_global(&self) -> bool
Returns whether this pass operates globally (across all methods). Read more
Source§fn initialize(&mut self, _host: &H) -> Result<(), Error>
fn initialize(&mut self, _host: &H) -> Result<(), Error>
Called once before the pass runs in a phase. Read more
Source§fn finalize(&mut self, _host: &H) -> Result<(), Error>
fn finalize(&mut self, _host: &H) -> Result<(), Error>
Called once after the pass completes in a phase. Read more
Source§fn modification_scope(&self) -> ModificationScope
fn modification_scope(&self) -> ModificationScope
Declares the extent of modifications this pass makes. Read more
Source§fn provides(&self) -> &[<T as Target>::Capability]
fn provides(&self) -> &[<T as Target>::Capability]
Returns the capabilities this pass provides after execution. Read more
Source§fn requires(&self) -> &[<T as Target>::Capability]
fn requires(&self) -> &[<T as Target>::Capability]
Returns the capabilities this pass requires before it can run. Read more
Source§fn reads_peer_ssa(&self) -> bool
fn reads_peer_ssa(&self) -> bool
Returns whether this pass reads other methods’ SSA during
run_on_method. Read moreSource§fn requires_full_scan(&self) -> bool
fn requires_full_scan(&self) -> bool
Returns whether this pass requires a full scan of all methods
every iteration. Read more
Source§fn fallback_layer(&self) -> usize
fn fallback_layer(&self) -> usize
Returns the fallback execution layer for this pass. Read more
Auto Trait Implementations§
impl Freeze for BlockMergingPass
impl RefUnwindSafe for BlockMergingPass
impl Send for BlockMergingPass
impl Sync for BlockMergingPass
impl Unpin for BlockMergingPass
impl UnsafeUnpin for BlockMergingPass
impl UnwindSafe for BlockMergingPass
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for T
impl<T> Downcast for T
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<F, T> IntoSample<T> for Fwhere
T: FromSample<F>,
impl<F, T> IntoSample<T> for Fwhere
T: FromSample<F>,
fn into_sample(self) -> T
Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
Read this value from the supplied reader. Same as
ReadEndian::read_from_little_endian().Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.