MimIR
MimIR is my Intermediate Representation
Loading...
Searching...
No Matches
mim::plug::buffer Namespace Reference

The buffer Plugin More...

Classes

class  LowerPtr
 Lowers the buffer abstraction to the low-level pointer representation. More...

Enumerations

<tt>buffer.alloc</tt>
enum class  alloc : flags_t
<tt>buffer.init</tt>
enum class  init : flags_t
<tt>buffer.lit</tt>
enum class  lit : flags_t
<tt>buffer.copy</tt>
enum class  copy : flags_t
<tt>buffer.free</tt>
enum class  free : flags_t
<tt>buffer.lower_ptr</tt>
enum class  lower_ptr : flags_t

Functions

const Def * type_buf (const Def *r, const Def *s, const Def *T)
 The buffer type buffer.Buf (r, s, T).
const Def * op_alloc (const Def *r, const Def *s, const Def *T, const Def *mem)
 buffer.alloc (r, s, T) mem ↦ [mem.M 0, buffer.Buf (r, s, T)].
const Def * op_read (const Def *r, const Def *s, const Def *T, const Def *mem, const Def *buf, const Def *idx)
 buffer.read (r, s, T) (mem, buf, idx) ↦ [mem.M 0, T].
const Def * op_write (const Def *r, const Def *s, const Def *T, const Def *mem, const Def *buf, const Def *idx, const Def *val)
 buffer.write (r, s, T) (mem, buf, idx, val) ↦ [mem.M 0, buffer.Buf (r, s, T)].
const Def * op_copy (const Def *r, const Def *s, const Def *T, const Def *mem, const Def *dst, const Def *src)
 buffer.copy (r, s, T) (mem, dst, src) ↦ mem.M 0 (copies the whole buffer src into dst).
const Def * op_read (const Def *mem, const Def *buf, const Def *idx)
 op_read with (r, s, T) read off the type of buf.
const Def * op_write (const Def *mem, const Def *buf, const Def *idx, const Def *val)
 op_write with (r, s, T) read off the type of buf.
const Def * op_copy (const Def *mem, const Def *dst, const Def *src)
 op_copy with (r, s, T) read off the type of dst.
const Def * op_free (const Def *r, const Def *s, const Def *T, const Def *mem, const Def *buf)
 buffer.free (r, s, T) (mem, buf) ↦ mem.M 0.
const Def * op_init (const Def *r, const Def *s, const Def *T, const Def *mem, const Def *val)
 buffer.init (r, s, T) (mem, val) ↦ [mem.M 0, buffer.Buf (r, s, T)] (initialised with the array value val).
const Def * op_lit (const Def *r, const Def *s, const Def *T, const Def *mem, const Def *val)
 buffer.lit (r, s, T) (mem, val) ↦ [mem.M 0, buffer.Buf (r, s, T)] (every element initialised to val).
static void reg_phases (Flags2Phases &phases)
void register_normalizers (Normalizers &normalizers)

Variables

static constexpr plugin_t Plugin_Id = 0xd61c71930000000

<tt>buffer.Buf</tt>

enum class  Buf : flags_t
const Def * normalize_Buf (const Def *, const Def *callee, const Def *arg)
 Buf (r, s, T) with literal size-1 axes in s ↦ Buf (r', s', T) with those axes dropped.

<tt>buffer.read</tt>

enum class  read : flags_t
const Def * normalize_read (const Def *type, const Def *, const Def *arg)
 read (constant v) idx ↦ v.

<tt>buffer.write</tt>

enum class  write : flags_t
const Def * normalize_write (const Def *, const Def *, const Def *)

<tt>buffer.shape</tt>

enum class  shape : flags_t
const Def * normalize_shape (const Def *type, const Def *callee, const Def *arg)
 shape (r, s, T) (buf, i) ↦ s#i; the logical shape, since the type of buf has its size-1 axes folded away.

Detailed Description

Enumeration Type Documentation

◆ alloc

enum class mim::plug::buffer::alloc : flags_t
strong

Definition at line 22 of file autogen.h.

◆ Buf

enum class mim::plug::buffer::Buf : flags_t
strong

Definition at line 14 of file autogen.h.

◆ copy

enum class mim::plug::buffer::copy : flags_t
strong

Definition at line 67 of file autogen.h.

◆ free

enum class mim::plug::buffer::free : flags_t
strong

Definition at line 74 of file autogen.h.

◆ init

enum class mim::plug::buffer::init : flags_t
strong

Definition at line 45 of file autogen.h.

◆ lit

enum class mim::plug::buffer::lit : flags_t
strong

Definition at line 52 of file autogen.h.

◆ lower_ptr

Definition at line 81 of file autogen.h.

◆ read

enum class mim::plug::buffer::read : flags_t
strong

Definition at line 29 of file autogen.h.

◆ shape

enum class mim::plug::buffer::shape : flags_t
strong

Definition at line 59 of file autogen.h.

◆ write

enum class mim::plug::buffer::write : flags_t
strong

Definition at line 37 of file autogen.h.

Function Documentation

◆ normalize_Buf()

const Def * mim::plug::buffer::normalize_Buf ( const Def * ,
const Def * callee,
const Def * arg )

Buf (r, s, T) with literal size-1 axes in s ↦ Buf (r', s', T) with those axes dropped.

This mirrors the folding of the corresponding array types («3, 1; T» ≡ «3; T»), so buffer types derived from logical shapes agree with the (folded) boundary types by construction.

Definition at line 12 of file normalizers.cpp.

References mim::Lit::isa(), normalize_Buf(), mim::Def::projs(), and mim::Def::world().

Referenced by normalize_Buf().

◆ normalize_read()

const Def * mim::plug::buffer::normalize_read ( const Def * type,
const Def * ,
const Def * arg )

read (constant v) idx ↦ v.

Definition at line 30 of file normalizers.cpp.

References mim::Axm::isa(), normalize_read(), and mim::Def::projs().

Referenced by normalize_read().

◆ normalize_shape()

const Def * mim::plug::buffer::normalize_shape ( const Def * type,
const Def * callee,
const Def * arg )

shape (r, s, T) (buf, i) ↦ s#i; the logical shape, since the type of buf has its size-1 axes folded away.

Definition at line 45 of file normalizers.cpp.

References normalize_shape(), and mim::Def::proj().

Referenced by normalize_shape().

◆ normalize_write()

const Def * mim::plug::buffer::normalize_write ( const Def * ,
const Def * ,
const Def *  )

Definition at line 42 of file normalizers.cpp.

References normalize_write().

Referenced by normalize_write().

◆ op_alloc()

const Def * mim::plug::buffer::op_alloc ( const Def * r,
const Def * s,
const Def * T,
const Def * mem )
inline

buffer.alloc (r, s, T) mem ↦ [mem.M 0, buffer.Buf (r, s, T)].

Definition at line 17 of file buffer.h.

References op_alloc().

Referenced by op_alloc(), and mim::plug::tensor::phase::LowerToMem::rewrite_imm_Insert().

◆ op_copy() [1/2]

const Def * mim::plug::buffer::op_copy ( const Def * mem,
const Def * dst,
const Def * src )
inline

op_copy with (r, s, T) read off the type of dst.

Definition at line 54 of file buffer.h.

References mim::Axm::isa(), op_copy(), and mim::Def::type().

◆ op_copy() [2/2]

const Def * mim::plug::buffer::op_copy ( const Def * r,
const Def * s,
const Def * T,
const Def * mem,
const Def * dst,
const Def * src )
inline

buffer.copy (r, s, T) (mem, dst, src) ↦ mem.M 0 (copies the whole buffer src into dst).

Definition at line 36 of file buffer.h.

References op_copy().

Referenced by op_copy(), op_copy(), and mim::plug::tensor::phase::LowerToMem::rewrite_imm_Insert().

◆ op_free()

const Def * mim::plug::buffer::op_free ( const Def * r,
const Def * s,
const Def * T,
const Def * mem,
const Def * buf )
inline

buffer.free (r, s, T) (mem, buf) ↦ mem.M 0.

Definition at line 60 of file buffer.h.

References op_free().

Referenced by op_free().

◆ op_init()

const Def * mim::plug::buffer::op_init ( const Def * r,
const Def * s,
const Def * T,
const Def * mem,
const Def * val )
inline

buffer.init (r, s, T) (mem, val) ↦ [mem.M 0, buffer.Buf (r, s, T)] (initialised with the array value val).

Definition at line 66 of file buffer.h.

References op_init().

Referenced by op_init().

◆ op_lit()

const Def * mim::plug::buffer::op_lit ( const Def * r,
const Def * s,
const Def * T,
const Def * mem,
const Def * val )
inline

buffer.lit (r, s, T) (mem, val) ↦ [mem.M 0, buffer.Buf (r, s, T)] (every element initialised to val).

Definition at line 72 of file buffer.h.

References op_lit().

Referenced by op_lit().

◆ op_read() [1/2]

const Def * mim::plug::buffer::op_read ( const Def * mem,
const Def * buf,
const Def * idx )
inline

op_read with (r, s, T) read off the type of buf.

Definition at line 42 of file buffer.h.

References mim::Axm::isa(), and op_read().

◆ op_read() [2/2]

const Def * mim::plug::buffer::op_read ( const Def * r,
const Def * s,
const Def * T,
const Def * mem,
const Def * buf,
const Def * idx )
inline

buffer.read (r, s, T) (mem, buf, idx) ↦ [mem.M 0, T].

Definition at line 23 of file buffer.h.

References op_read().

Referenced by op_read(), op_read(), and mim::plug::tensor::phase::LowerToMem::rewrite_imm_Extract().

◆ op_write() [1/2]

const Def * mim::plug::buffer::op_write ( const Def * mem,
const Def * buf,
const Def * idx,
const Def * val )
inline

op_write with (r, s, T) read off the type of buf.

Definition at line 48 of file buffer.h.

References mim::Axm::isa(), and op_write().

◆ op_write() [2/2]

const Def * mim::plug::buffer::op_write ( const Def * r,
const Def * s,
const Def * T,
const Def * mem,
const Def * buf,
const Def * idx,
const Def * val )
inline

buffer.write (r, s, T) (mem, buf, idx, val) ↦ [mem.M 0, buffer.Buf (r, s, T)].

Definition at line 30 of file buffer.h.

References op_write().

Referenced by mim::plug::btensor::build_pointwise(), op_write(), op_write(), and mim::plug::tensor::phase::LowerToMem::rewrite_imm_Insert().

◆ reg_phases()

void mim::plug::buffer::reg_phases ( Flags2Phases & phases)
static

Definition at line 11 of file buffer.cpp.

References mim::Phase::hook(), and reg_phases().

Referenced by MIM_PLUGIN_ENTRY(), and reg_phases().

◆ register_normalizers()

void mim::plug::buffer::register_normalizers ( Normalizers & normalizers)

◆ type_buf()

const Def * mim::plug::buffer::type_buf ( const Def * r,
const Def * s,
const Def * T )
inline

The buffer type buffer.Buf (r, s, T).

Definition at line 11 of file buffer.h.

References type_buf().

Referenced by type_buf().

Variable Documentation

◆ Plugin_Id

plugin_t mim::plug::buffer::Plugin_Id = 0xd61c71930000000
staticconstexpr

Definition at line 10 of file autogen.h.