pub struct ForOp { /* private fields */ }Implementations§
Source§impl ForOp
impl ForOp
pub fn new( ctx: &mut Context, results: Vec<TypeHandle>, start: Value, end: Value, step: Value, carried_values_init: Vec<Value>, ) -> Self
pub fn iter_var(&self, ctx: &Context) -> Value
pub fn start(&self, ctx: &Context) -> Value
pub fn end(&self, ctx: &Context) -> Value
pub fn step(&self, ctx: &Context) -> Value
pub fn initial_carried_values(&self, ctx: &Context) -> Vec<Value>
pub fn push_initial_carried_value( &self, ctx: &mut Context, value: Value, ) -> usize
pub fn remove_initial_carried_value( &self, ctx: &mut Context, opd_idx: usize, ) -> Value
pub fn carried_values(&self, ctx: &Context) -> Vec<Value>
pub fn get_carried_value(&self, ctx: &Context, arg_idx: usize) -> Value
pub fn push_carried_value(&self, ctx: &mut Context, ty: TypeHandle) -> usize
pub fn remove_carried_value(&self, ctx: &Context, arg_idx: usize)
pub fn loop_region(&self, ctx: &Context) -> Ptr<Region>
pub fn loop_body(&self, ctx: &Context) -> Ptr<BasicBlock>
pub fn results(&self, ctx: &Context) -> Vec<Value>
pub fn result_types(&self, ctx: &Context) -> Vec<TypeHandle>
Trait Implementations§
Source§impl CanonicalizeInterface for ForOp
impl CanonicalizeInterface for ForOp
impl Copy for ForOp
impl Eq for ForOp
Source§impl MemoryEffectsOp for ForOp
impl MemoryEffectsOp for ForOp
Source§impl MemorySSARegionOpInterface for ForOp
impl MemorySSARegionOpInterface for ForOp
Source§fn setup_memory_ssa(
&self,
ctx: &Context,
state: &mut MemorySSAContext,
reaching_def: MemoryValue,
has_memory_defs: bool,
regions_to_process: &mut SmallMap<Ptr<Region>, MemoryValue, 2>,
)
fn setup_memory_ssa( &self, ctx: &Context, state: &mut MemorySSAContext, reaching_def: MemoryValue, has_memory_defs: bool, regions_to_process: &mut SmallMap<Ptr<Region>, MemoryValue, 2>, )
Called before descending into nested regions.
reaching_def is the state of the memory on entry to this op.
Populate regions_to_process with the reaching def each region starts with.Source§fn finalize_memory_ssa(
&self,
ctx: &Context,
_state: &mut MemorySSAContext,
entry_reaching_def: MemoryValue,
has_memory_defs: bool,
_reaching_at_region_entry: &HMap<Ptr<Region>, MemoryValue>,
reaching_at_block_end: &HMap<Ptr<BasicBlock>, MemoryValue>,
region_phis: &mut SmallMap<Ptr<Region>, RegionMemoryPhiInputs, 2>,
) -> RegionMemoryValue
fn finalize_memory_ssa( &self, ctx: &Context, _state: &mut MemorySSAContext, entry_reaching_def: MemoryValue, has_memory_defs: bool, _reaching_at_region_entry: &HMap<Ptr<Region>, MemoryValue>, reaching_at_block_end: &HMap<Ptr<BasicBlock>, MemoryValue>, region_phis: &mut SmallMap<Ptr<Region>, RegionMemoryPhiInputs, 2>, ) -> RegionMemoryValue
Called after reaching defs are computed for all regions.
Returns the new reaching def at the op’s exit.
If values need to be merged at the start of a nested region, the input values must be added
to
region_phis. This will insert a memory phi at the beginning of the region’s entry block,
with the result value being the one added to regions_to_process in setup_memory_ssa.fn verify(_op: &dyn Op, _ctx: &Context) -> Result<()>where
Self: Sized,
Source§impl OneRegionInterface for ForOp
impl OneRegionInterface for ForOp
Source§impl Op for ForOp
impl Op for ForOp
Source§fn get_operation(&self) -> Ptr<Operation>
fn get_operation(&self) -> Ptr<Operation>
Get the underlying IR Operation
Source§fn get_opid_static() -> OpId
fn get_opid_static() -> OpId
Get this Op’s OpId, without self reference.
Source§fn get_concrete_op_info() -> (fn(Ptr<Operation>) -> OpBox, TypeId)where
Self: Sized,
fn get_concrete_op_info() -> (fn(Ptr<Operation>) -> OpBox, TypeId)where
Self: Sized,
Get details about the concrete Op type.
Source§impl OperandSegmentInterface for ForOp
impl OperandSegmentInterface for ForOp
Source§fn compute_segment_sizes(
operands: Vec<Vec<Value>>,
) -> (Vec<Value>, OperandSegmentSizesAttr)where
Self: Sized,
fn compute_segment_sizes(
operands: Vec<Vec<Value>>,
) -> (Vec<Value>, OperandSegmentSizesAttr)where
Self: Sized,
Given a list of segmented operands, compute the segment sizes and flatten the operands
(ready for use in constructing an operation).
Call
set_operand_segment_sizes with the computed segment sizes to set the attribute.Source§fn segment_range(&self, ctx: &Context, seg_idx: usize) -> Range<usize> ⓘ
fn segment_range(&self, ctx: &Context, seg_idx: usize) -> Range<usize> ⓘ
Return the index range of operands in segment
seg_idx of this Op.
Panics if seg_idx is out of bounds.Source§fn get_segment(&self, ctx: &Context, seg_idx: usize) -> Vec<Value>
fn get_segment(&self, ctx: &Context, seg_idx: usize) -> Vec<Value>
Get the
seg_idxth segment of operands.
Panics if seg_idx is out of bounds.Source§fn segment_size(&self, ctx: &Context, seg_idx: usize) -> u32
fn segment_size(&self, ctx: &Context, seg_idx: usize) -> u32
Get the length of the
seg_idxth segment.Source§fn num_segments(&self, ctx: &Context) -> usize
fn num_segments(&self, ctx: &Context) -> usize
Get the number of segments.
Source§fn set_operand_segment_sizes(
&self,
ctx: &Context,
sizes: OperandSegmentSizesAttr,
)
fn set_operand_segment_sizes( &self, ctx: &Context, sizes: OperandSegmentSizesAttr, )
Set the
operand_segment_sizes attribute for this operation.Source§fn get_operand_segment_sizes(&self, ctx: &Context) -> OperandSegmentSizesAttr
fn get_operand_segment_sizes(&self, ctx: &Context) -> OperandSegmentSizesAttr
Get the
operand_segment_sizes attribute for this operation.Source§fn push_to_segment(
&self,
ctx: &mut Context,
seg_idx: usize,
operand: Value,
) -> usize
fn push_to_segment( &self, ctx: &mut Context, seg_idx: usize, operand: Value, ) -> usize
Push a new operand at the end of the
seg_idxth segment.
Returns the index of the inserted operand within that segment.Source§fn pop_from_segment(&self, ctx: &mut Context, seg_idx: usize) -> Value
fn pop_from_segment(&self, ctx: &mut Context, seg_idx: usize) -> Value
Pop and return the last operand in the
seg_idxth segment.Source§impl Parsable for ForOp
impl Parsable for ForOp
Source§type Arg = Vec<(Identifier, Location)>
type Arg = Vec<(Identifier, Location)>
Type of the argument that must be passed to the parser.
Source§fn parse<'a>(
state_stream: &mut StateStream<'a>,
results: Self::Arg,
) -> ParseResult<'a, Self::Parsed>
fn parse<'a>( state_stream: &mut StateStream<'a>, results: Self::Arg, ) -> ParseResult<'a, Self::Parsed>
Define a parser using existing combinators and call
into on Parser::parse_stream to get the final ParseResult.
Use state_stream.state as necessary.Source§fn parser<'a>(
arg: Self::Arg,
) -> Box<dyn Parser<Stream<Stream<Stream<Stream<IteratorStream<CharIterator<'a>>, SourcePosition>>>, State<'a>>, PartialState = (), Output = Self::Parsed> + 'a>where
Self::Parsed: 'a,
fn parser<'a>(
arg: Self::Arg,
) -> Box<dyn Parser<Stream<Stream<Stream<Stream<IteratorStream<CharIterator<'a>>, SourcePosition>>>, State<'a>>, PartialState = (), Output = Self::Parsed> + 'a>where
Self::Parsed: 'a,
Get a parser combinator that can work on StateStream as its input.
Source§impl Printable for ForOp
impl Printable for ForOp
Source§impl PromotableRegionOpInterface for ForOp
impl PromotableRegionOpInterface for ForOp
Source§fn is_region_promotable(
&self,
_: &Context,
_: &AllocInfo,
_: Ptr<Region>,
_: bool,
) -> bool
fn is_region_promotable( &self, _: &Context, _: &AllocInfo, _: Ptr<Region>, _: bool, ) -> bool
Returns true if
region (a child of this op) can be analysed for
promotion with respect to alloc.
has_value_stores is a hint: true when the region contains stores to alloc.Source§fn setup_promotion(
&self,
ctx: &mut Context,
alloc: &AllocInfo,
reaching_def: Value,
has_value_stores: bool,
regions_to_process: &mut SmallMap<Ptr<Region>, Value, 2>,
)
fn setup_promotion( &self, ctx: &mut Context, alloc: &AllocInfo, reaching_def: Value, has_value_stores: bool, regions_to_process: &mut SmallMap<Ptr<Region>, Value, 2>, )
Called before descending into nested regions.
reaching_def is the value in slot on entry to this op.
Populate regions_to_process with the reaching def each region starts with.
You may mutate the op in place, but do NOT delete ops or touch terminators.Source§fn finalize_promotion(
&self,
ctx: &mut Context,
alloc: &AllocInfo,
entry_reaching_def: Value,
has_value_stores: bool,
reaching_at_block_end: &HMap<Ptr<BasicBlock>, Value>,
) -> Value
fn finalize_promotion( &self, ctx: &mut Context, alloc: &AllocInfo, entry_reaching_def: Value, has_value_stores: bool, reaching_at_block_end: &HMap<Ptr<BasicBlock>, Value>, ) -> Value
Called after reaching defs are computed for all regions, but before
blocking uses are removed. Returns the new reaching def at the op’s exit.
Mutation is allowed, but you must not change control flow or add ops that
interact with the slot’s value.
fn verify(_op: &dyn Op, _ctx: &Context) -> Result<()>where
Self: Sized,
Source§impl RegionBranchOpInterface for ForOp
impl RegionBranchOpInterface for ForOp
Source§fn entry_successor_operands(
&self,
ctx: &Context,
_: RegionSuccessor,
) -> Vec<Use<Value>>
fn entry_successor_operands( &self, ctx: &Context, _: RegionSuccessor, ) -> Vec<Use<Value>>
Returns the operands of this operation that are forwarded to the
successor inputs when branching to
successor. successor is
guaranteed to be among the successors that are returned by
entry_successor_regions/successor_regions(parent()). Read moreSource§fn successor_regions(
&self,
ctx: &Context,
_pred: RegionPredecessor,
) -> Vec<RegionSuccessor>
fn successor_regions( &self, ctx: &Context, _pred: RegionPredecessor, ) -> Vec<RegionSuccessor>
Returns all potential region successors when branching from
predecessor.
These are the regions that may be selected during the flow of control. Read moreSource§fn successor_inputs(
&self,
ctx: &Context,
successor: RegionSuccessor,
) -> Vec<Value>
fn successor_inputs( &self, ctx: &Context, successor: RegionSuccessor, ) -> Vec<Value>
Return all successor inputs for the given region successor. If the
given region successor is a region, then the returned values are block
arguments. Otherwise, if the given region successor is an operation,
the returned values are op results.
fn verify(_op: &dyn Op, _ctx: &Context) -> Result<()>where
Self: Sized,
Source§fn entry_successor_regions(
&self,
ctx: &Context,
operands: &[Option<AttrObj>],
) -> Vec<RegionSuccessor>
fn entry_successor_regions( &self, ctx: &Context, operands: &[Option<AttrObj>], ) -> Vec<RegionSuccessor>
Returns all potential region successors when first executing the op. Read more
Source§fn all_successor_regions_of_region(
&self,
ctx: &Context,
region: Ptr<Region>,
) -> Vec<RegionSuccessor>
fn all_successor_regions_of_region( &self, ctx: &Context, region: Ptr<Region>, ) -> Vec<RegionSuccessor>
Returns all potential region successors when branching from any
terminator in
region.Source§fn predecessors(
&self,
ctx: &Context,
successor: RegionSuccessor,
) -> Vec<RegionPredecessor>
fn predecessors( &self, ctx: &Context, successor: RegionSuccessor, ) -> Vec<RegionPredecessor>
Returns all potential branching points (predecessors) for a given
region successor.
Source§fn predecessor_values(
&self,
ctx: &Context,
successor: RegionSuccessor,
index: usize,
) -> Vec<Use<Value>>
fn predecessor_values( &self, ctx: &Context, successor: RegionSuccessor, index: usize, ) -> Vec<Use<Value>>
Returns all potential values across all (predecessors) for a given successor
input.
Source§fn region_invocation_bounds(
&self,
ctx: &Context,
operands: &[Option<AttrObj>],
) -> Vec<InvocationBounds>
fn region_invocation_bounds( &self, ctx: &Context, operands: &[Option<AttrObj>], ) -> Vec<InvocationBounds>
Populates
invocationBounds with the minimum and maximum number of
times this operation will invoke the attached regions (assuming the
regions yield normally, i.e. do not abort or invoke an infinite loop).
The minimum number of invocations is at least 0. If the maximum number
of invocations cannot be statically determined, then it will be set to
InvocationBounds::getUnknown(). Read moreSource§fn are_types_compatible(
&self,
ctx: &Context,
lhs: TypeHandle,
rhs: TypeHandle,
) -> bool
fn are_types_compatible( &self, ctx: &Context, lhs: TypeHandle, rhs: TypeHandle, ) -> bool
This method is called to compare types along control-flow edges. By
default, the types are checked as equal.
Source§impl SideEffects for ForOp
impl SideEffects for ForOp
Source§fn has_side_effects(&self, ctx: &Context) -> bool
fn has_side_effects(&self, ctx: &Context) -> bool
Returns
true if the operation has side effects, and false otherwise.Source§impl SingleBlockRegionInterface for ForOp
impl SingleBlockRegionInterface for ForOp
impl StructuralPartialEq for ForOp
Source§impl UniformRegionOpInterface for ForOp
impl UniformRegionOpInterface for ForOp
fn result_uniformity( &self, _ctx: &Context, operands: &[Uniformity], ) -> Uniformity
fn entry_successor_region_uniformity( &self, _ctx: &Context, operands: &[Uniformity], ) -> Vec<Uniformity>
fn verify(_op: &dyn Op, _ctx: &Context) -> Result<()>where
Self: Sized,
Auto Trait Implementations§
impl !RefUnwindSafe for ForOp
impl !UnwindSafe for ForOp
impl Freeze for ForOp
impl Send for ForOp
impl Sync for ForOp
impl Unpin for ForOp
impl UnsafeUnpin for ForOp
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 Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Converts
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Converts
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Converts
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Converts
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.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 more