pub struct AllocaOperation<'c> { /* private fields */ }
Expand description

An alloca operation. Stack memory allocation operation.

The alloca operation allocates memory on the stack, to be automatically released when control transfers back from the region of its closest surrounding operation with an AutomaticAllocationScope trait. The amount of memory allocated is specified by its memref and additional operands. For example:

%0 = memref.alloca() : memref<8x64xf32>

The optional list of dimension operands are bound to the dynamic dimensions specified in its memref type. In the example below, the SSA value ‘%d’ is bound to the second dimension of the memref (which is dynamic).

%0 = memref.alloca(%d) : memref<8x?xf32>

The optional list of symbol operands are bound to the symbols of the memref’s affine map. In the example below, the SSA value ‘%s’ is bound to the symbol ‘s0’ in the affine map specified in the allocs memref type.

%0 = memref.alloca()[%s] : memref<8x64xf32,
                           affine_map<(d0, d1)[s0] -> ((d0 + s0), d1)>>

This operation returns a single SSA value of memref type, which can be used by subsequent load and store operations. An optional alignment attribute, if specified, guarantees alignment at least to that boundary. If not specified, an alignment on any convenient boundary compatible with the type will be chosen.

Implementations§

source§

impl<'c> AllocaOperation<'c>

source

pub fn name() -> &'static str

Returns a name.

source

pub fn as_operation(&self) -> &Operation<'c>

Returns a generic operation.

source

pub fn builder( context: &'c Context, location: Location<'c> ) -> AllocaOperationBuilder<'c, Unset, Unset, Unset>

Creates a builder.

source

pub fn memref(&self) -> Result<OperationResult<'c, '_>, Error>

source

pub fn dynamic_sizes( &self ) -> Result<impl Iterator<Item = Value<'c, '_>>, Error>

source

pub fn symbol_operands( &self ) -> Result<impl Iterator<Item = Value<'c, '_>>, Error>

source

pub fn alignment(&self) -> Result<IntegerAttribute<'c>, Error>

source

pub fn set_alignment(&mut self, value: IntegerAttribute<'c>)

source

pub fn remove_alignment(&mut self) -> Result<(), Error>

Trait Implementations§

source§

impl<'c> From<AllocaOperation<'c>> for Operation<'c>

source§

fn from(operation: AllocaOperation<'c>) -> Self

Converts to this type from the input type.
source§

impl<'c> TryFrom<Operation<'c>> for AllocaOperation<'c>

§

type Error = Error

The type returned in the event of a conversion error.
source§

fn try_from(operation: Operation<'c>) -> Result<Self, Self::Error>

Performs the conversion.

Auto Trait Implementations§

§

impl<'c> RefUnwindSafe for AllocaOperation<'c>

§

impl<'c> !Send for AllocaOperation<'c>

§

impl<'c> !Sync for AllocaOperation<'c>

§

impl<'c> Unpin for AllocaOperation<'c>

§

impl<'c> UnwindSafe for AllocaOperation<'c>

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.