pub struct ExtractAlignedPointerAsIndexOperation<'c> { /* private fields */ }
Expand description
An extract_aligned_pointer_as_index
operation. Extracts a memref’s underlying aligned pointer as an index.
Extracts the underlying aligned pointer as an index.
This operation is useful for lowering to lower-level dialects while still avoiding the need to define a pointer type in higher-level dialects such as the memref dialect.
This operation is intended solely as step during lowering, it has no side effects. A reverse operation that creates a memref from an index interpreted as a pointer is explicitly discouraged.
Example:
%0 = memref.extract_aligned_pointer_as_index %arg : memref<4x4xf32> -> index
%1 = arith.index_cast %0 : index to i64
%2 = llvm.inttoptr %1 : i64 to !llvm.ptr<f32>
call @foo(%2) : (!llvm.ptr<f32>) ->()
Implementations§
source§impl<'c> ExtractAlignedPointerAsIndexOperation<'c>
impl<'c> ExtractAlignedPointerAsIndexOperation<'c>
sourcepub fn as_operation(&self) -> &Operation<'c>
pub fn as_operation(&self) -> &Operation<'c>
Returns a generic operation.
sourcepub fn builder(
context: &'c Context,
location: Location<'c>
) -> ExtractAlignedPointerAsIndexOperationBuilder<'c, Unset, Unset>
pub fn builder( context: &'c Context, location: Location<'c> ) -> ExtractAlignedPointerAsIndexOperationBuilder<'c, Unset, Unset>
Creates a builder.
pub fn aligned_pointer(&self) -> Result<OperationResult<'c, '_>, Error>
pub fn source(&self) -> Result<Value<'c, '_>, Error>
Trait Implementations§
source§impl<'c> From<ExtractAlignedPointerAsIndexOperation<'c>> for Operation<'c>
impl<'c> From<ExtractAlignedPointerAsIndexOperation<'c>> for Operation<'c>
source§fn from(operation: ExtractAlignedPointerAsIndexOperation<'c>) -> Self
fn from(operation: ExtractAlignedPointerAsIndexOperation<'c>) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl<'c> RefUnwindSafe for ExtractAlignedPointerAsIndexOperation<'c>
impl<'c> !Send for ExtractAlignedPointerAsIndexOperation<'c>
impl<'c> !Sync for ExtractAlignedPointerAsIndexOperation<'c>
impl<'c> Unpin for ExtractAlignedPointerAsIndexOperation<'c>
impl<'c> UnwindSafe for ExtractAlignedPointerAsIndexOperation<'c>
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