Skip to main content

Module ssa_range_prop

Module ssa_range_prop 

Source
Expand description

A pass that propagates the known ranges of SSA locals. We can know the ranges of SSA locals in certain locations for the following code:

fn foo(a: u32) {
  let b = a < 9; // the integer representation of b is within the full range [0, 2).
  if b {
    let c = b; // c is true since b is within the range [1, 2).
    let d = a < 8; // d is true since a is within the range [0, 9).
  }
}

Re-exportsยง

use rustc_abi::WrappingRange; ๐Ÿ”’
use rustc_const_eval::interpret::Scalar; ๐Ÿ”’
use rustc_data_structures::fx::FxHashMap; ๐Ÿ”’
use rustc_data_structures::graph::dominators::Dominators; ๐Ÿ”’
use rustc_middle::mir::basic_blocks::Predecessors; ๐Ÿ”’
use rustc_middle::mir::visit::MutVisitor; ๐Ÿ”’
use rustc_middle::mir::BasicBlock; ๐Ÿ”’
use rustc_middle::mir::Body; ๐Ÿ”’
use rustc_middle::mir::Location; ๐Ÿ”’
use rustc_middle::mir::Operand; ๐Ÿ”’
use rustc_middle::mir::Place; ๐Ÿ”’
use rustc_middle::mir::TerminatorKind; ๐Ÿ”’
use rustc_middle::ty::TyCtxt; ๐Ÿ”’
use rustc_middle::ty::TypingEnv; ๐Ÿ”’
use rustc_span::DUMMY_SP; ๐Ÿ”’
use crate::PassPolicy; ๐Ÿ”’
use crate::ssa::SsaLocals; ๐Ÿ”’
use rustc_middle::mir::*; ๐Ÿ”’

Structsยง

RangeSet ๐Ÿ”’
SsaRangePropagation ๐Ÿ”’