Modules

  • add_retag 🔒
    This pass adds validation calls (AcquireValid, ReleaseValid) where appropriate. It has to be run really early, before transformations like inlining, because introducing these calls adds UB – so, conceptually, this pass is actually part of MIR building, and only after this pass we think of the program has having the normal MIR semantics.
  • This module provides a pass that removes parts of MIR that are no longer relevant after analysis phase and borrowck. In particular, it removes false edges, user type annotations and replaces following statements with Nops:
  • Finds locals which are assigned once to a const and unused except for debuginfo and converts their debuginfo to use the const directly, allowing the local to be removed.
  • const_goto 🔒
    This pass optimizes the following sequence
  • const_prop 🔒
    Propagates constants for early reporting of statically known assertion failures
  • Propagates constants for early reporting of statically known assertion failures
  • copy_prop 🔒
  • coroutine 🔒
    This is the implementation of the pass which transforms coroutines into state machines.
  • coverage 🔒
  • ctfe_limit 🔒
    A pass that inserts the ConstEvalCounter instruction into any blocks that have a back edge (thus indicating there is a loop in the CFG), or whose terminator is a function call.
  • A constant propagation optimization pass based on dataflow analysis.
  • This module implements a dead store elimination (DSE) routine.
  • Deduces supplementary parameter attributes from MIR.
  • This pass finds basic blocks that are completely equal, and replaces all uses with just one of them.
  • dest_prop 🔒
    Propagates assignment destinations backwards in the CFG to eliminate redundant assignments.
  • This pass just dumps MIR at a specified point.
  • This pass transforms derefs of Box into a deref of the pointer inside Box.
  • errors 🔒
  • gvn 🔒
    Global value numbering.
  • Inlining pass for MIR functions
  • Performs various peephole optimizations.
  • A jump threading optimization.
  • lint 🔒
    This pass statically detects code which has undefined behaviour or is likely to be erroneous. It can be used to locate problems in MIR building or optimizations. It assumes that all code can be executed, so it has false positives.
  • Lowers intrinsic calls
  • This pass lowers calls to core::slice::len to just Len op. It should run before inlining!
  • This pass removes jumps to basic blocks containing only a return, and replaces them with a return instead.
  • This pass eliminates casting of arrays into slices when their length is taken using .len() method. Handy to preserve information in MIR for const prop
  • nrvo 🔒
    See the docs for RenameReturnPlace.
  • prettify 🔒
    These two passes provide no value to the compiler, so are off at every level.
  • A pass that promotes borrows of constant rvalues.
  • ref_prop 🔒
  • This pass removes PlaceMention statement, which has no effect at codegen.
  • This pass removes storage markers if they won’t be emitted during codegen.
  • This pass replaces a drop of a type that does not need dropping, with a goto.
  • Removes operations on ZST places, and convert ZST operands to constants.
  • reveal_all 🔒
    Normalizes MIR in RevealAll mode.
  • A pass that duplicates switch-terminated blocks into a new copy for each predecessor, provided the predecessor sets the value being switched over to a constant.
  • shim 🔒
  • A number of passes which remove various redundancies in the CFG.
  • sroa 🔒
  • ssa 🔒
    We denote as “SSA” the set of locals that verify the following properties: 1/ They are only assigned-to once, either as a function parameter, or in an assign statement; 2/ This single assignment dominates all uses;
  • A pass that eliminates branches on uninhabited enum variants.
  • A pass that propagates the unreachable terminator of a block to its predecessors when all of their successors are unreachable. This is achieved through a post-order traversal of the blocks.

Statics

  • Raw content of Fluent resource for this crate, generated by fluent_messages macro, imported by rustc_driver to include all crates’ resources in one bundle.

Functions