Skip to documentation
SLOP

tiny.choir.dialects.memref.MemrefDialect

Reference tiny.choir dialects memref MemrefDialect

Defined in dialects.memref.

API (154)

Actions

Public operations.

Types and contracts

Public types and contracts.

Values and defaults

Public values and defaults.

No direct callersNo direct callsdialects.memrefMemrefDialect
Static calls · unresolved targets: unknown · external targets: unknown.

Source

Source: lib/choir/src/dialects/memref.zig:202

zig
pub const MemrefDialect = struct {    pub const name = "memref";    const op_specs = ir.dialects.opSpec.dialect(@This());    const op_templates = ir.dialects.operationTemplate.dialect(@This());    pub const spec = ir.dialects.dialectSpec(@This(), .{        .types = &.{ir.dialects.typeName(name)},        .type_interface_fallbacks = &.{            .{ .id = interfaces.TypeParamInterface.id, .fallback = typeParamFallback },            .{ .id = interfaces.ShapedTypeInterface.id, .fallback = shapedTypeFallback },        },    });    pub const MemrefTypePayload = struct {        size: ?u64,        element_type_name: []const u8,        element_type: ?ir.Type,        addr_space: AddressSpace,        alignment: ?u64,        exclusive: ?bool,        indexing: ?Indexing,        shape_storage: [1]u64 = [_]u64{0},        shape: ?[]const u64 = null,    };    const type_param_vtable = interfaces.TypeParamInterface.VTable{        .parse = parseTypeParams,    };    const shaped_type_vtable = interfaces.ShapedTypeInterface.VTable{        .getRank = shapedGetRank,        .getShape = shapedGetShape,        .getElementType = shapedGetElementType,        .getAddressSpaceTag = shapedGetAddressSpaceTag,    };    pub const MemrefTypeAttrs = struct {        alignment: ?u64 = null,        exclusive: ?bool = null,        indexing: ?Indexing = null,    };    pub const MemrefParams = struct {        size: ?u64,        element_type_name: []const u8,        addr_space: AddressSpace,        alignment: ?u64 = null,        exclusive: ?bool = null,        indexing: ?Indexing = null,    };    pub const LayoutAttrs = struct {        offset: ?u64 = null,        shape: ?[]const u64 = null,        stride: ?[]const u64 = null,    };    pub const AllocOp = struct {        op: *ir.Operation,        const leaf = op_templates.explicitLeaf(@This(), .{            .mnemonic = "alloc",            .interfaces = &.{allocationEffects("heap")},            .operands = ir.dialects.shape.atMost(1),            .operand_names = .{"dynamic_size"},            .results = .{"memref"},        });        pub const operation_spec = leaf.operation_spec;        pub const operation_name = leaf.operation_name;        pub const createLeaf = leaf.createLeaf;        pub const getOptionalOperand = leaf.getOptionalOperand;        pub fn createStatic(            ctx: *ir.Context,            loc: ir.Location,            result_type: ir.Type,        ) !AllocOp {            return @This().createLeaf(ctx, loc, &.{}, &.{result_type});        }        pub fn createDynamic(            ctx: *ir.Context,            loc: ir.Location,            size: *ir.Value,            result_type: ir.Type,        ) !AllocOp {            return @This().createLeaf(ctx, loc, &.{size}, &.{result_type});        }        pub fn getResult(self: *const AllocOp) *ir.Value {            return leaf.getResult(self.*);        }        pub fn getDynamicSize(self: AllocOp) ?*ir.Value {            return self.getOptionalOperand("dynamic_size");        }    };    /// Allocates per-invocation storage. Its contents are undefined until stored;    /// loading an element before storing it has no defined result on any backend.    /// The CPU twin maps a local alloca to host stack storage without zeroing it.    pub const AllocaOp = struct {        op: *ir.Operation,        const leaf = op_templates.explicitLeaf(@This(), .{            .mnemonic = "alloca",            .interfaces = &.{allocationEffects("stack")},            .operands = ir.dialects.shape.atMost(1),            .operand_names = .{"dynamic_size"},            .results = .{"memref"},        });        pub const operation_spec = leaf.operation_spec;        pub const operation_name = leaf.operation_name;        pub const createLeaf = leaf.createLeaf;        pub const getOptionalOperand = leaf.getOptionalOperand;        pub fn createStatic(            ctx: *ir.Context,            loc: ir.Location,            result_type: ir.Type,        ) !AllocaOp {            return @This().createLeaf(ctx, loc, &.{}, &.{result_type});        }        pub fn createDynamic(            ctx: *ir.Context,            loc: ir.Location,            size: *ir.Value,            result_type: ir.Type,        ) !AllocaOp {            return @This().createLeaf(ctx, loc, &.{size}, &.{result_type});        }        pub fn getResult(self: *const AllocaOp) *ir.Value {            return leaf.getResult(self.*);        }        pub fn getDynamicSize(self: AllocaOp) ?*ir.Value {            return self.getOptionalOperand("dynamic_size");        }    };    /// A module level declaration of storage that code addresses by name.    ///    /// The placement follows from two attributes rather than being spelled a third time.    /// `constant` with `initial` bytes is storage nothing writes, `initial` bytes without    /// `constant` is storage code may write, and neither is an extent the loader fills with    /// zeroes and the image carries no bytes for. `constant` with nothing to be constant about    /// is refused, because the only thing it could mean is a read only run of zeroes that no    /// one can ever have written.    ///    /// The type travels as a one element type list because the builtin attributes carry a list    /// of types and not a single one, and this operation has no result to carry it on.    pub const GlobalOp = struct {        op: *ir.Operation,        pub const attr_names = struct {            pub const sym_name = "sym_name";            pub const memref_type = "type";            pub const alignment = "alignment";            pub const constant = "constant";            pub const initial = "initial";        };        const leaf = op_templates.explicitLeaf(@This(), .{            .mnemonic = "global",            .operands = 0,            .results = 0,            .required_attrs = .{                ir.dialects.attribute.string(attr_names.sym_name),                ir.dialects.attribute.any(attr_names.memref_type),                ir.dialects.attribute.integer(attr_names.alignment),                ir.dialects.attribute.boolean(attr_names.constant),            },            .attrs = .{ir.dialects.attribute.string(attr_names.initial)},            .interfaces = &.{effects.EffectOpInterface.entryFor(.{ .complete = true })},        });        pub const operation_spec = leaf.operation_spec;        pub const operation_name = leaf.operation_name;        pub const createLeaf = leaf.createLeaf;        pub const verify = verifyGlobalOp;        pub const Declaration = struct {            sym_name: []const u8,            memref_type: ir.Type,            alignment: u64 = 1,            constant: bool = false,            /// Bytes the image carries. Absent declares an extent of zeroes instead.            initial: ?[]const u8 = null,        };        pub fn create(            ctx: *ir.Context,            loc: ir.Location,            declaration: Declaration,        ) !GlobalOp {            try loadSpec(ctx);            if (declaration.alignment > std.math.maxInt(i64)) {                return MemrefVerifyError.GlobalInvalidAlignment;            }            const self = try @This().createLeaf(ctx, loc, &.{}, &.{});            errdefer self.op.erase();            const names = attr_names;            try self.op.setAttr(names.sym_name, try ctx.getStringAttr(declaration.sym_name));            try self.op.setAttr(                names.memref_type,                try ctx.getTypeListAttr(&.{declaration.memref_type}),            );            try self.op.setAttr(                names.alignment,                try ctx.getI64Attr(@intCast(declaration.alignment)),            );            try self.op.setAttr(names.constant, try ctx.getBoolAttr(declaration.constant));            if (declaration.initial) |bytes| {                try self.op.setAttr(names.initial, try ctx.getStringAttr(bytes));            }            try verifyGlobal(self.op);            return self;        }        pub fn getSymName(self: GlobalOp) ?[]const u8 {            const attr = self.op.getAttrAs(ir.Attribute.StringAttr, attr_names.sym_name) orelse                return null;            return attr.getValue();        }        pub fn getType(self: GlobalOp) ?ir.Type {            const attr = self.op.getAttrAs(                ir.Attribute.TypeListAttr,                attr_names.memref_type,            ) orelse return null;            const values = attr.getValues();            if (values.len != 1) return null;            return values[0];        }        pub fn getAlignment(self: GlobalOp) ?u64 {            const attr = self.op.getAttrAs(ir.Attribute.IntegerAttr, attr_names.alignment) orelse                return null;            const value = attr.getValue();            if (value < 0) return null;            return @intCast(value);        }        pub fn isConstant(self: GlobalOp) ?bool {            const attr = self.op.getAttrAs(ir.Attribute.BoolAttr, attr_names.constant) orelse                return null;            return attr.getValue();        }        pub fn getInitial(self: GlobalOp) ?[]const u8 {            const attr = self.op.getAttrAs(ir.Attribute.StringAttr, attr_names.initial) orelse                return null;            return attr.getValue();        }        /// Where this global's storage comes from, or null when the attributes do not decide it.        pub fn getPlacement(self: GlobalOp) ?GlobalPlacement {            const constant = self.isConstant() orelse return null;            if (self.getInitial() == null) {                if (constant) return null;                return .zeroed;            }            return if (constant) .read_only else .writable;        }    };    /// The address of a global, as a memref value of that global's declared type.    ///    /// This computes an address and touches nothing, so it declares one result and no event.    /// Reading or writing through the result is what `memref.load` and `memref.store` declare.    pub const GetGlobalOp = struct {        op: *ir.Operation,        pub const attr_names = struct {            pub const sym_name = "sym_name";        };        const leaf = op_templates.explicitLeaf(@This(), .{            .mnemonic = "get_global",            .operands = 0,            .results = .{"memref"},            .required_attrs = .{ir.dialects.attribute.string(attr_names.sym_name)},            .interfaces = &.{effects.EffectOpInterface.entryFor(.{                .complete = true,                .facts = &.{.{ .result = .{ .index = 0, .ownership = .none } }},            })},        });        pub const operation_spec = leaf.operation_spec;        pub const operation_name = leaf.operation_name;        pub const createLeaf = leaf.createLeaf;        pub const verify = verifyGetGlobalOp;        pub fn create(            ctx: *ir.Context,            loc: ir.Location,            sym_name: []const u8,            result_type: ir.Type,        ) !GetGlobalOp {            try loadSpec(ctx);            const self = try @This().createLeaf(ctx, loc, &.{}, &.{result_type});            errdefer self.op.erase();            try self.op.setAttr(attr_names.sym_name, try ctx.getStringAttr(sym_name));            try verifyGetGlobal(self.op);            return self;        }        pub fn getResult(self: *const GetGlobalOp) *ir.Value {            return self.op.getResult(0).?;        }        pub fn getSymName(self: GetGlobalOp) ?[]const u8 {            const attr = self.op.getAttrAs(ir.Attribute.StringAttr, attr_names.sym_name) orelse                return null;            return attr.getValue();        }    };    pub const DeallocOp = struct {        op: *ir.Operation,        pub const operation_spec = op_specs.leaf(.{            .mnemonic = "dealloc",            .interfaces = &.{effects.EffectOpInterface.entryFor(.{ .facts = &.{                .{ .requirement = .{ .kind = .live, .subject = .{ .operand = 0 } } },                .{ .event = .{ .kind = .free, .resource = .{ .subject = .{ .operand = 0 } } } },            } })},            .operands = 1,            .results = 0,        });        pub const operation_name = operation_spec.name;        pub fn create(            ctx: *ir.Context,            loc: ir.Location,            memref: *ir.Value,        ) !DeallocOp {            var builder = ir.OperationBuilder.init(ctx);            var state = op_specs.state(@This(), loc);            state.addOperands(&.{memref});            const op = try builder.create(state);            return .{ .op = op };        }        pub fn getMemref(self: DeallocOp) *ir.Value {            return self.op.operands.items[0].value;        }    };    pub const FenceOp = struct {        op: *ir.Operation,        pub const operation_spec = op_specs.leaf(.{            .mnemonic = "fence",            .interfaces = &.{effects.EffectOpInterface.entryFor(.{ .facts = &.{.{                .event = .{ .kind = .synchronize, .ordered = true },            }} })},            .operands = 0,            .results = 0,            .attrs = &.{ "scope", "ordering" },            .traits = ir.OperationTraits{},        });        pub const operation_name = operation_spec.name;        pub fn create(            ctx: *ir.Context,            loc: ir.Location,            scope: FenceScope,            ordering: FenceOrdering,        ) !FenceOp {            var builder = ir.OperationBuilder.init(ctx);            const op = try builder.create(op_specs.state(@This(), loc));            errdefer op.erase();            try setFenceScopeAttr(op, ctx, scope);            try setFenceOrderingAttr(op, ctx, ordering);            return .{ .op = op };        }        pub fn getScope(self: FenceOp) ?FenceScope {            return getFenceScopeAttr(self.op);        }        pub fn getOrdering(self: FenceOp) ?FenceOrdering {            return getFenceOrderingAttr(self.op);        }    };    pub const LoadOp = struct {        op: *ir.Operation,        pub const operation_spec = op_specs.leaf(.{            .mnemonic = "load",            .interfaces = &.{accessEffects(0, 1, true, false, false)},            .operands = 2,            .results = 1,            .attrs = &.{ "cache", "eviction" },            .traits = ir.OperationTraits{},        });        pub const operation_name = operation_spec.name;        pub fn create(            ctx: *ir.Context,            loc: ir.Location,            memref: *ir.Value,            index: *ir.Value,            result_type: ir.Type,        ) !LoadOp {            var builder = ir.OperationBuilder.init(ctx);            var state = op_specs.state(@This(), loc);            state.addOperands(&.{ memref, index });            state.addTypes(&.{result_type});            const op = try builder.create(state);            return .{ .op = op };        }        pub fn createWithCache(            ctx: *ir.Context,            loc: ir.Location,            memref: *ir.Value,            index: *ir.Value,            result_type: ir.Type,            cache: ?CacheOperation,            eviction: ?CacheEviction,        ) !LoadOp {            const load = try create(ctx, loc, memref, index, result_type);            errdefer load.op.erase();            if (cache) |hint| {                try setCacheOperationAttr(load.op, ctx, hint);            }            if (eviction) |hint| {                try setCacheEvictionAttr(load.op, ctx, hint);            }            return load;        }        pub fn getResult(self: *const LoadOp) *ir.Value {            return self.op.getResult(0).?;        }        pub fn getMemref(self: LoadOp) *ir.Value {            return self.op.operands.items[0].value;        }        pub fn getIndex(self: LoadOp) *ir.Value {            return self.op.operands.items[1].value;        }        pub fn getCacheOperation(self: LoadOp) ?CacheOperation {            return getCacheOperationAttr(self.op);        }        pub fn getCacheEviction(self: LoadOp) ?CacheEviction {            return getCacheEvictionAttr(self.op);        }    };    pub const StoreOp = struct {        op: *ir.Operation,        pub const operation_spec = op_specs.leaf(.{            .mnemonic = "store",            .interfaces = &.{accessEffects(1, 2, false, true, false)},            .operands = 3,            .results = 0,            .attrs = &.{ "cache", "eviction" },            .traits = ir.OperationTraits{},        });        pub const operation_name = operation_spec.name;        pub fn create(            ctx: *ir.Context,            loc: ir.Location,            value: *ir.Value,            memref: *ir.Value,            index: *ir.Value,        ) !StoreOp {            var builder = ir.OperationBuilder.init(ctx);            var state = op_specs.state(@This(), loc);            state.addOperands(&.{ value, memref, index });            const op = try builder.create(state);            return .{ .op = op };        }        pub fn createWithCache(            ctx: *ir.Context,            loc: ir.Location,            value: *ir.Value,            memref: *ir.Value,            index: *ir.Value,            cache: ?CacheOperation,            eviction: ?CacheEviction,        ) !StoreOp {            const store = try create(ctx, loc, value, memref, index);            errdefer store.op.erase();            if (cache) |hint| {                try setCacheOperationAttr(store.op, ctx, hint);            }            if (eviction) |hint| {                try setCacheEvictionAttr(store.op, ctx, hint);            }            return store;        }        pub fn getValue(self: StoreOp) *ir.Value {            return self.op.operands.items[0].value;        }        pub fn getMemref(self: StoreOp) *ir.Value {            return self.op.operands.items[1].value;        }        pub fn getIndex(self: StoreOp) *ir.Value {            return self.op.operands.items[2].value;        }        pub fn getCacheOperation(self: StoreOp) ?CacheOperation {            return getCacheOperationAttr(self.op);        }        pub fn getCacheEviction(self: StoreOp) ?CacheEviction {            return getCacheEvictionAttr(self.op);        }    };    pub const AtomicRmwOp = struct {        op: *ir.Operation,        pub const operation_spec = op_specs.leaf(.{            .mnemonic = "atomic_rmw",            .interfaces = &.{accessEffects(1, 2, true, true, true)},            .operands = 3,            .results = 1,            .attrs = &.{"kind"},            .traits = ir.OperationTraits{},        });        pub const operation_name = operation_spec.name;        pub fn create(            ctx: *ir.Context,            loc: ir.Location,            kind: AtomicRmwKind,            value: *ir.Value,            memref: *ir.Value,            index: *ir.Value,            result_type: ir.Type,        ) !AtomicRmwOp {            var builder = ir.OperationBuilder.init(ctx);            var state = op_specs.state(@This(), loc);            state.addOperands(&.{ value, memref, index });            state.addTypes(&.{result_type});            const op = try builder.create(state);            errdefer op.erase();            const kind_attr = try ctx.getDialectAttr("memref.atomic_kind", kind.toString());            try op.setAttr("kind", kind_attr);            return .{ .op = op };        }        pub fn getKind(self: AtomicRmwOp) ?AtomicRmwKind {            const dialect_attr = self.op.getAttrAs(ir.Attribute.DialectAttr, "kind") orelse return null;            return AtomicRmwKind.fromString(dialect_attr.payload);        }        pub fn getValue(self: AtomicRmwOp) *ir.Value {            return self.op.operands.items[0].value;        }        pub fn getMemref(self: AtomicRmwOp) *ir.Value {            return self.op.operands.items[1].value;        }        pub fn getIndex(self: AtomicRmwOp) *ir.Value {            return self.op.operands.items[2].value;        }        pub fn getResult(self: *const AtomicRmwOp) *ir.Value {            return self.op.getResult(0).?;        }    };    /// Reads one element atomically: no other thread observes a torn word, and the read is    /// ordered by `ordering`, which is `acquire` or `seq_cst` because a load cannot release.    pub const AtomicLoadOp = struct {        op: *ir.Operation,        pub const operation_spec = op_specs.leaf(.{            .mnemonic = "atomic_load",            .interfaces = &.{accessEffects(0, 1, true, false, true)},            .operands = 2,            .results = 1,            .required_attrs = .{ir.dialects.attribute.dialect("ordering", "memref.fence_ordering")},            .traits = ir.OperationTraits{},        });        pub const operation_name = operation_spec.name;        pub const verify = verifyAtomicLoadOp;        pub fn create(            ctx: *ir.Context,            loc: ir.Location,            memref: *ir.Value,            index: *ir.Value,            result_type: ir.Type,            ordering: FenceOrdering,        ) !AtomicLoadOp {            var builder = ir.OperationBuilder.init(ctx);            var state = op_specs.state(@This(), loc);            state.addOperands(&.{ memref, index });            state.addTypes(&.{result_type});            const op = try builder.create(state);            errdefer op.erase();            try setFenceOrderingAttr(op, ctx, ordering);            try verifyAtomicLoad(op);            return .{ .op = op };        }        pub fn getMemref(self: AtomicLoadOp) *ir.Value {            return self.op.operands.items[0].value;        }        pub fn getIndex(self: AtomicLoadOp) *ir.Value {            return self.op.operands.items[1].value;        }        pub fn getOrdering(self: AtomicLoadOp) ?FenceOrdering {            return getFenceOrderingAttr(self.op);        }        pub fn getResult(self: *const AtomicLoadOp) *ir.Value {            return self.op.getResult(0).?;        }    };    /// Writes one element atomically, ordered by `ordering`, which is `release` or `seq_cst`    /// because a store cannot acquire.    pub const AtomicStoreOp = struct {        op: *ir.Operation,        pub const operation_spec = op_specs.leaf(.{            .mnemonic = "atomic_store",            .interfaces = &.{accessEffects(1, 2, false, true, true)},            .operands = 3,            .results = 0,            .required_attrs = .{ir.dialects.attribute.dialect("ordering", "memref.fence_ordering")},            .traits = ir.OperationTraits{},        });        pub const operation_name = operation_spec.name;        pub const verify = verifyAtomicStoreOp;        pub fn create(            ctx: *ir.Context,            loc: ir.Location,            value: *ir.Value,            memref: *ir.Value,            index: *ir.Value,            ordering: FenceOrdering,        ) !AtomicStoreOp {            var builder = ir.OperationBuilder.init(ctx);            var state = op_specs.state(@This(), loc);            state.addOperands(&.{ value, memref, index });            const op = try builder.create(state);            errdefer op.erase();            try setFenceOrderingAttr(op, ctx, ordering);            try verifyAtomicStore(op);            return .{ .op = op };        }        pub fn getValue(self: AtomicStoreOp) *ir.Value {            return self.op.operands.items[0].value;        }        pub fn getMemref(self: AtomicStoreOp) *ir.Value {            return self.op.operands.items[1].value;        }        pub fn getIndex(self: AtomicStoreOp) *ir.Value {            return self.op.operands.items[2].value;        }        pub fn getOrdering(self: AtomicStoreOp) ?FenceOrdering {            return getFenceOrderingAttr(self.op);        }    };    pub const AtomicCasOp = struct {        op: *ir.Operation,        pub const operation_spec = op_specs.leaf(.{            .mnemonic = "atomic_cas",            .interfaces = &.{accessEffects(2, 3, true, true, true)},            .operands = 4,            .results = 1,            .attrs = .{ir.dialects.attribute.dialect("ordering", "memref.fence_ordering")},            .traits = ir.OperationTraits{},        });        pub const operation_name = operation_spec.name;        pub const verify = verifyAtomicCasOp;        pub fn create(            ctx: *ir.Context,            loc: ir.Location,            expected: *ir.Value,            desired: *ir.Value,            memref: *ir.Value,            index: *ir.Value,            result_type: ir.Type,        ) !AtomicCasOp {            var builder = ir.OperationBuilder.init(ctx);            var state = op_specs.state(@This(), loc);            state.addOperands(&.{ expected, desired, memref, index });            state.addTypes(&.{result_type});            const op = try builder.create(state);            return .{ .op = op };        }        pub fn getExpected(self: AtomicCasOp) *ir.Value {            return self.op.operands.items[0].value;        }        pub fn getDesired(self: AtomicCasOp) *ir.Value {            return self.op.operands.items[1].value;        }        pub fn getMemref(self: AtomicCasOp) *ir.Value {            return self.op.operands.items[2].value;        }        pub fn getIndex(self: AtomicCasOp) *ir.Value {            return self.op.operands.items[3].value;        }        /// The same exchange with its ordering spelled. Every ordering is legal on a compare        /// and swap, which both reads and writes.        pub fn createOrdered(            ctx: *ir.Context,            loc: ir.Location,            expected: *ir.Value,            desired: *ir.Value,            memref: *ir.Value,            index: *ir.Value,            result_type: ir.Type,            ordering: FenceOrdering,        ) !AtomicCasOp {            const cas = try create(ctx, loc, expected, desired, memref, index, result_type);            errdefer cas.op.erase();            try setFenceOrderingAttr(cas.op, ctx, ordering);            return cas;        }        /// The ordering the exchange carries, `seq_cst` when none is spelled.        pub fn getOrdering(self: AtomicCasOp) FenceOrdering {            return getFenceOrderingAttr(self.op) orelse .seq_cst;        }        pub fn getResult(self: *const AtomicCasOp) *ir.Value {            return self.op.getResult(0).?;        }    };    pub const CopyOp = struct {        op: *ir.Operation,        pub const operation_spec = op_specs.leaf(.{            .mnemonic = "copy",            .interfaces = &.{effects.EffectOpInterface.entryFor(.{ .facts = &.{                .{ .event = .{ .kind = .read, .resource = .{ .subject = .{ .operand = 0 } } } },                .{ .event = .{ .kind = .write, .resource = .{ .subject = .{ .operand = 1 } } } },            } })},            .operands = 2,            .results = 0,        });        pub const operation_name = operation_spec.name;        pub fn create(            ctx: *ir.Context,            loc: ir.Location,            src: *ir.Value,            dst: *ir.Value,        ) !CopyOp {            var builder = ir.OperationBuilder.init(ctx);            var state = op_specs.state(@This(), loc);            state.addOperands(&.{ src, dst });            const op = try builder.create(state);            return .{ .op = op };        }        pub fn getSrc(self: CopyOp) *ir.Value {            return self.op.operands.items[0].value;        }        pub fn getDst(self: CopyOp) *ir.Value {            return self.op.operands.items[1].value;        }    };    pub const SubviewOp = struct {        op: *ir.Operation,        pub const operation_spec = op_specs.leaf(.{            .mnemonic = "subview",            .interfaces = &.{aliasEffects()},            .operands = 1,            .results = 1,            .attrs = &.{ "offset", "shape", "stride" },        });        pub const operation_name = operation_spec.name;        pub fn create(            ctx: *ir.Context,            loc: ir.Location,            source: *ir.Value,            result_type: ir.Type,        ) !SubviewOp {            var builder = ir.OperationBuilder.init(ctx);            var state = op_specs.state(@This(), loc);            state.addOperands(&.{source});            state.addTypes(&.{result_type});            const op = try builder.create(state);            return .{ .op = op };        }        pub fn getResult(self: *const SubviewOp) *ir.Value {            return self.op.getResult(0).?;        }        pub fn getSource(self: SubviewOp) *ir.Value {            return self.op.operands.items[0].value;        }        pub fn getShapePayload(self: SubviewOp) ?[]const u8 {            return getLayoutPayload(self.op, "shape");        }        pub fn getStridePayload(self: SubviewOp) ?[]const u8 {            return getLayoutPayload(self.op, "stride");        }        pub fn getOffsetPayload(self: SubviewOp) ?[]const u8 {            return getLayoutPayload(self.op, "offset");        }    };    /// A memref over a byte offset into a byte addressed base, with the offset unscaled.    ///    /// This is the one spelling for reaching a value inside an arena. `memref.load` and    /// `memref.store` scale their index by the element size of the memref they are given, so a    /// byte offset cannot be expressed as an index into a base of wider elements, and    /// `memref.subview` carries a static offset attribute rather than a value. Here the base is    /// 8 bit elements, the offset is one `index` operand added to the base unscaled, and loads    /// and stores through the result scale by the RESULT's element size.    ///    /// The result type is the result's own type rather than a repeated attribute, so there is    /// one statement of it that cannot disagree with itself.    ///    /// The arithmetic is one add and touches no memory, but the VALUE is a borrow: the result    /// points inside the base's storage. So this declares the base borrowed and the result an    /// alias of it, the same as `memref.subview` and `memref.transpose`. Declaring an    /// independent result instead would tell a consumer that a write through the view cannot    /// reach the base, which is the one thing that is never true here.    ///    /// Aligning the offset is the producer's duty. This operation does not check it, at    /// verification or at run time, because the offset is a value and the alignment a value    /// must satisfy is a property of what the producer intends to store there.    pub const ViewOp = struct {        op: *ir.Operation,        pub const operation_spec = op_specs.leaf(.{            .mnemonic = "view",            .interfaces = &.{aliasEffects()},            .operands = 2,            .results = 1,        });        pub const operation_name = operation_spec.name;        pub const verify = verifyViewOp;        pub fn create(            ctx: *ir.Context,            loc: ir.Location,            base: *ir.Value,            byte_offset: *ir.Value,            result_type: ir.Type,        ) !ViewOp {            var builder = ir.OperationBuilder.init(ctx);            var state = op_specs.state(@This(), loc);            state.addOperands(&.{ base, byte_offset });            state.addTypes(&.{result_type});            const op = try builder.create(state);            errdefer op.erase();            try verifyView(op);            return .{ .op = op };        }        pub fn getResult(self: *const ViewOp) *ir.Value {            return self.op.getResult(0).?;        }        pub fn getBase(self: ViewOp) *ir.Value {            return self.op.operands.items[0].value;        }        pub fn getByteOffset(self: ViewOp) *ir.Value {            return self.op.operands.items[1].value;        }    };    pub const TransposeOp = struct {        op: *ir.Operation,        pub const operation_spec = op_specs.leaf(.{            .mnemonic = "transpose",            .interfaces = &.{aliasEffects()},            .operands = 1,            .results = 1,            .attrs = &.{ "shape", "stride" },        });        pub const operation_name = operation_spec.name;        pub fn create(            ctx: *ir.Context,            loc: ir.Location,            source: *ir.Value,            result_type: ir.Type,        ) !TransposeOp {            var builder = ir.OperationBuilder.init(ctx);            var state = op_specs.state(@This(), loc);            state.addOperands(&.{source});            state.addTypes(&.{result_type});            const op = try builder.create(state);            return .{ .op = op };        }        pub fn getResult(self: *const TransposeOp) *ir.Value {            return self.op.getResult(0).?;        }        pub fn getSource(self: TransposeOp) *ir.Value {            return self.op.operands.items[0].value;        }        pub fn getShapePayload(self: TransposeOp) ?[]const u8 {            return getLayoutPayload(self.op, "shape");        }        pub fn getStridePayload(self: TransposeOp) ?[]const u8 {            return getLayoutPayload(self.op, "stride");        }    };    fn deinitPayload(allocator: std.mem.Allocator, ptr: *anyopaque) void {        const payload: *MemrefTypePayload = @ptrCast(@alignCast(ptr));        allocator.destroy(payload);    }    fn typeParamFallback(ctx: *const ir.Context, typ: ir.Type) ?*const anyopaque {        _ = ctx;        const type_name = typ.getDialectTypeName() orelse return null;        if (!std.mem.eql(u8, type_name, name)) return null;        return &type_param_vtable;    }    fn shapedTypeFallback(ctx: *const ir.Context, typ: ir.Type) ?*const anyopaque {        _ = ctx;        const type_name = typ.getDialectTypeName() orelse return null;        if (!std.mem.eql(u8, type_name, name)) return null;        return &shaped_type_vtable;    }    fn loadSpec(ctx: *ir.Context) !void {        ir.dialects.loadDialectSpec(ctx, spec) catch |err| switch (err) {            error.ContextFrozen => {},            else => return err,        };    }    fn payloadFromTypePtr(ctx: *ir.Context, type_ptr: *const anyopaque) ?*const MemrefTypePayload {        loadSpec(ctx) catch return null;        const storage: *const ir.Type.DialectTypeStorage = @ptrCast(@alignCast(type_ptr));        const typ = ir.Type{            .type_id = .dialect_type,            .impl = storage,        };        return ctx.getTypeParamPayload(typ, MemrefTypePayload) catch null;    }    fn parseTypeParams(type_ptr: *const anyopaque, ctx_opaque: *const interfaces.ContextOpaque) anyerror!?interfaces.TypeParamPayload {        const ctx = interfaces.castContext(ir.Context, ctx_opaque);        const storage: *const ir.Type.DialectTypeStorage = @ptrCast(@alignCast(type_ptr));        if (storage.param_key.len == 0) return null;        const params = parseMemrefParams(storage.param_key) orelse return null;        const payload = try ir.context.typePayloadAllocator(ctx).create(MemrefTypePayload);        payload.* = .{            .size = params.size,            .element_type_name = params.element_type_name,            .element_type = ctx.getDialectTypeFromName(params.element_type_name) catch null,            .addr_space = params.addr_space,            .alignment = params.alignment,            .exclusive = params.exclusive,            .indexing = params.indexing,        };        if (params.size) |size| {            payload.shape_storage[0] = size;            payload.shape = payload.shape_storage[0..1];        } else {            payload.shape = null;        }        return .{ .ptr = payload, .deinit = deinitPayload };    }    fn shapedGetRank(type_ptr: *const anyopaque, ctx_opaque: *const interfaces.ContextOpaque) ?usize {        const ctx = interfaces.castContext(ir.Context, ctx_opaque);        const payload = payloadFromTypePtr(ctx, type_ptr) orelse return null;        _ = payload;        return 1;    }    fn shapedGetShape(type_ptr: *const anyopaque, ctx_opaque: *const interfaces.ContextOpaque) ?[]const u64 {        const ctx = interfaces.castContext(ir.Context, ctx_opaque);        const payload = payloadFromTypePtr(ctx, type_ptr) orelse return null;        return payload.shape;    }    fn shapedGetElementType(type_ptr: *const anyopaque, ctx_opaque: *const interfaces.ContextOpaque) ?ir.Type {        const ctx = interfaces.castContext(ir.Context, ctx_opaque);        const payload = payloadFromTypePtr(ctx, type_ptr) orelse return null;        return payload.element_type;    }    fn shapedGetAddressSpaceTag(type_ptr: *const anyopaque, ctx_opaque: *const interfaces.ContextOpaque) ?u8 {        const ctx = interfaces.castContext(ir.Context, ctx_opaque);        const payload = payloadFromTypePtr(ctx, type_ptr) orelse return null;        return @backingInt(payload.addr_space);    }    pub fn getMemrefType1D(        ctx: *ir.Context,        size: u64,        element_type: ir.Type,        addr_space: AddressSpace,    ) !ir.Type {        return getMemrefType1DWithAttrs(ctx, size, element_type, addr_space, .{});    }    pub fn getMemrefTypeDynamic(        ctx: *ir.Context,        element_type: ir.Type,        addr_space: AddressSpace,    ) !ir.Type {        return getMemrefTypeDynamicWithAttrs(ctx, element_type, addr_space, .{});    }    pub fn getMemrefType1DWithAttrs(        ctx: *ir.Context,        size: u64,        element_type: ir.Type,        addr_space: AddressSpace,        attrs: MemrefTypeAttrs,    ) !ir.Type {        try loadSpec(ctx);        var buf: [512]u8 = undefined;        const elem_name = element_type.getDialectTypeName() orelse "unknown";        var pos: usize = 0;        pos = try ir.format.appendFmt(buf[0..], pos, "{d},{s},{s}", .{            size,            elem_name,            addr_space.toString(),        });        pos = try appendTypeAttrs(buf[0..], pos, attrs);        return ctx.getDialectTypeFromNameWithKey("memref", buf[0..pos]);    }    pub fn getMemrefTypeDynamicWithAttrs(        ctx: *ir.Context,        element_type: ir.Type,        addr_space: AddressSpace,        attrs: MemrefTypeAttrs,    ) !ir.Type {        try loadSpec(ctx);        var buf: [512]u8 = undefined;        const elem_name = element_type.getDialectTypeName() orelse "unknown";        var pos: usize = 0;        pos = try ir.format.appendFmt(buf[0..], pos, "?,{s},{s}", .{            elem_name,            addr_space.toString(),        });        pos = try appendTypeAttrs(buf[0..], pos, attrs);        return ctx.getDialectTypeFromNameWithKey("memref", buf[0..pos]);    }    pub fn parseMemrefParams(param_key: []const u8) ?MemrefParams {        var section_iter = std.mem.splitScalar(u8, param_key, ';');        const base = section_iter.next() orelse return null;        var iter = std.mem.splitScalar(u8, base, ',');        const size_str = iter.next() orelse return null;        const size: ?u64 = if (std.mem.eql(u8, size_str, "?"))            null        else            std.fmt.parseInt(u64, size_str, 10) catch return null;        const elem_type = iter.next() orelse return null;        const addr_space_str = iter.next() orelse return null;        const addr_space = AddressSpace.fromString(addr_space_str) orelse return null;        var alignment: ?u64 = null;        var exclusive: ?bool = null;        var indexing: ?Indexing = null;        while (section_iter.next()) |section| {            if (section.len == 0) continue;            var kv_iter = std.mem.splitScalar(u8, section, '=');            const key = kv_iter.next() orelse continue;            const value = kv_iter.next() orelse continue;            if (kv_iter.next() != null) return null;            if (std.mem.eql(u8, key, "alignment") or std.mem.eql(u8, key, "align")) {                alignment = std.fmt.parseInt(u64, value, 10) catch return null;                continue;            }            if (std.mem.eql(u8, key, "exclusive")) {                if (std.mem.eql(u8, value, "true")) {                    exclusive = true;                } else if (std.mem.eql(u8, value, "false")) {                    exclusive = false;                } else {                    return null;                }                continue;            }            if (std.mem.eql(u8, key, "indexing")) {                indexing = Indexing.fromString(value) orelse return null;                continue;            }        }        return .{            .size = size,            .element_type_name = elem_type,            .addr_space = addr_space,            .alignment = alignment,            .exclusive = exclusive,            .indexing = indexing,        };    }    fn formatDims(buf: *std.ArrayListUnmanaged(u8), allocator: std.mem.Allocator, dims: []const u64) !void {        if (dims.len == 0) return;        for (dims, 0..) |dim, i| {            if (i > 0) try buf.append(allocator, ',');            var tmp: [32]u8 = undefined;            const text = try std.fmt.bufPrint(&tmp, "{d}", .{dim});            try buf.appendSlice(allocator, text);        }    }    fn setLayoutDimsAttr(op: *ir.Operation, ctx: *ir.Context, attr_name: []const u8, full_name: []const u8, dims: []const u64) !void {        var buf: std.ArrayListUnmanaged(u8) = .empty;        const allocator = ir.context.transientAllocator(ctx);        defer buf.deinit(allocator);        try formatDims(&buf, allocator, dims);        const attr = try ctx.getDialectAttr(full_name, buf.items);        try op.setAttr(attr_name, attr);    }    fn setLayoutOffsetAttr(op: *ir.Operation, ctx: *ir.Context, offset: u64) !void {        var buf: [32]u8 = undefined;        const payload = try std.fmt.bufPrint(&buf, "{d}", .{offset});        const attr = try ctx.getDialectAttr("memref.offset", payload);        try op.setAttr("offset", attr);    }    fn getLayoutPayload(op: *const ir.Operation, attr_name: []const u8) ?[]const u8 {        const dialect_attr = op.getAttrAs(ir.Attribute.DialectAttr, attr_name) orelse return null;        return dialect_attr.payload;    }    pub fn setLayoutAttrs(op: *ir.Operation, ctx: *ir.Context, attrs: LayoutAttrs) !void {        if (attrs.offset) |offset| {            try setLayoutOffsetAttr(op, ctx, offset);        }        if (attrs.shape) |shape| {            try setLayoutDimsAttr(op, ctx, "shape", "memref.shape", shape);        }        if (attrs.stride) |stride| {            try setLayoutDimsAttr(op, ctx, "stride", "memref.stride", stride);        }    }    fn setCacheOperationAttr(op: *ir.Operation, ctx: *ir.Context, cache: CacheOperation) !void {        const cache_attr = try ctx.getDialectAttr("memref.cache", cache.toString());        try op.setAttr("cache", cache_attr);    }    fn getCacheOperationAttr(op: *const ir.Operation) ?CacheOperation {        const dialect_attr = op.getAttrAs(ir.Attribute.DialectAttr, "cache") orelse return null;        return CacheOperation.fromString(dialect_attr.payload);    }    fn setCacheEvictionAttr(op: *ir.Operation, ctx: *ir.Context, eviction: CacheEviction) !void {        const eviction_attr = try ctx.getDialectAttr("memref.eviction", eviction.toString());        try op.setAttr("eviction", eviction_attr);    }    fn getCacheEvictionAttr(op: *const ir.Operation) ?CacheEviction {        const dialect_attr = op.getAttrAs(ir.Attribute.DialectAttr, "eviction") orelse return null;        return CacheEviction.fromString(dialect_attr.payload);    }    fn setFenceScopeAttr(op: *ir.Operation, ctx: *ir.Context, scope: FenceScope) !void {        const attr = try ctx.getDialectAttr("memref.fence_scope", scope.toString());        try op.setAttr("scope", attr);    }    fn getFenceScopeAttr(op: *const ir.Operation) ?FenceScope {        const dialect_attr = op.getAttrAs(ir.Attribute.DialectAttr, "scope") orelse return null;        return FenceScope.fromString(dialect_attr.payload);    }    fn setFenceOrderingAttr(op: *ir.Operation, ctx: *ir.Context, ordering: FenceOrdering) !void {        const attr = try ctx.getDialectAttr("memref.fence_ordering", ordering.toString());        try op.setAttr("ordering", attr);    }    fn getFenceOrderingAttr(op: *const ir.Operation) ?FenceOrdering {        const dialect_attr = op.getAttrAs(ir.Attribute.DialectAttr, "ordering") orelse return null;        return FenceOrdering.fromString(dialect_attr.payload);    }    fn appendTypeAttrs(buf: []u8, start: usize, attrs: MemrefTypeAttrs) !usize {        var pos = start;        if (attrs.alignment) |alignment| {            pos = try ir.format.appendFmt(buf, pos, ";alignment={d}", .{alignment});        }        if (attrs.exclusive) |exclusive| {            pos = try ir.format.appendFmt(                buf,                pos,                ";exclusive={s}",                .{if (exclusive) "true" else "false"},            );        }        if (attrs.indexing) |indexing| {            pos = try ir.format.appendFmt(buf, pos, ";indexing={s}", .{indexing.toString()});        }        return pos;    }};
Called byCallsNo direct callsprivate sourcelib.accy.src.kernel.model.core.builder.BuilderdynamicSharedBuffertest sourcelib.choir.src.backends.gpu.featurestest: target features infer dynamic s...test sourcelib.choir.src.backends.x64.backendtest: x86 64 memref alloc/free roundt...test sourcelib.choir.src.backends.x64.backendtest: x86 64 memref alloc returns san...test sourcelib.choir.src.backends.x64.backendtest: x86 64 memref f32 add load+3 moredialects.MemrefDialect.AllocOpcreateDynamic
Static calls · unresolved targets: 0 · external targets: 0.
Called byCallsNo direct callsprivate sourcelib.accy.src.kernel.model.core.builder.BuildersharedBuffertest sourcelib.choir.src.backends.gpu.featurestest: target features classify f32 at...test sourcelib.choir.src.backends.gpu.featurestest: target features infer async cop...test sourcelib.choir.src.backends.gpu.featurestest: target features infer atomics f...test sourcelib.choir.src.backends.gpu.featurestest: target features infer dynamic s...+20 moredialects.MemrefDialect.AllocOpcreateStatic
Static calls · unresolved targets: 0 · external targets: 0.
Called byCallsNo direct callersdialects.MemrefDialect.AllocOpgetOptionalOperanddialects.MemrefDialect.AllocOpgetDynamicSize
Static calls · unresolved targets: 0 · external targets: 0.
Called byCallsNo direct callstiny.chantlower.memoryallocaObjecttiny.chantlower.memoryallocaScalarprivate sourcelib.choir.src.backends.gpu.cpu.stage.LowererlowerOperationtest sourcelib.choir.src.dialects.memref.test_MemrefDialectAllocaOp creates local allocationtest sourcelib.choir.src.dialects.memref.test_MemrefDialectViewOp offsets a byte base and refuse...dialects.MemrefDialect.AllocaOpcreateStatic
Static calls · unresolved targets: 0 · external targets: 0.
Called byCallsNo direct callersdialects.MemrefDialect.AllocaOpgetOptionalOperanddialects.MemrefDialect.AllocaOpgetDynamicSize
Static calls · unresolved targets: 0 · external targets: 0.
Called byCallsNo direct callsprivate sourcelib.accy.src.kernel.model.core.builder.BuilderatomicCastest sourcelib.choir.src.backends.gpu.spirv.emitter.codegentest: spirv codegen emits memref inte...test sourcelib.choir.src.dialects.memref.test_MemrefDialectAtomicCasOp carries operands and old-...test sourcelib.choir.src.dialects.memreftest: MemrefDialect atomic load and s...dialects.MemrefDialect.AtomicCasOpcreate
Static calls · unresolved targets: 0 · external targets: 5.
Called byCallstest sourcelib.choir.src.dialects.memreftest: MemrefDialect atomic load and s...private sourcelib.choir.src.dialects.memref.MemrefDialectsetFenceOrderingAttrdialects.MemrefDialect.AtomicCasOpcreateOrdered
Static calls · unresolved targets: 1 · external targets: 1.
Called byCallsNo direct callersprivate sourcelib.choir.src.dialects.memref.MemrefDialectgetFenceOrderingAttrdialects.MemrefDialect.AtomicCasOpgetOrdering
Static calls · unresolved targets: 0 · external targets: 0.
Called byCallstest sourcelib.choir.src.dialects.memreftest: MemrefDialect atomic load and s...private sourcelib.choir.src.dialects.memref.MemrefDialectsetFenceOrderingAttrprivate sourcelib.choir.src.dialects.memrefverifyAtomicLoaddialects.MemrefDialect.AtomicLoadOpcreate
Static calls · unresolved targets: 0 · external targets: 6.
Called byCallsNo direct callersprivate sourcelib.choir.src.dialects.memref.MemrefDialectgetFenceOrderingAttrdialects.MemrefDialect.AtomicLoadOpgetOrdering
Static calls · unresolved targets: 0 · external targets: 0.
Called byCallsNo direct callsprivate sourcelib.accy.src.kernel.model.core.builder.BuilderatomicRmwtest sourcelib.choir.src.backends.gpu.featurestest: target features classify f32 at...test sourcelib.choir.src.backends.gpu.featurestest: target features infer atomics f...test sourcelib.choir.src.backends.gpu.featurestest: target features mark unsupporte...test sourcelib.choir.src.backends.gpu.spirv.emitter.codegentest: spirv codegen emits memref inte...+4 moredialects.MemrefDialect.AtomicRmwOpcreate
Static calls · unresolved targets: 0 · external targets: 9.
Called byCallsNo direct callersdialects.AtomicRmwKindfromStringdialects.MemrefDialect.AtomicRmwOpgetKind
Static calls · unresolved targets: 0 · external targets: 1.
Called byCallstest sourcelib.choir.src.dialects.memreftest: MemrefDialect atomic load and s...private sourcelib.choir.src.dialects.memref.MemrefDialectsetFenceOrderingAttrprivate sourcelib.choir.src.dialects.memrefverifyAtomicStoredialects.MemrefDialect.AtomicStoreOpcreate
Static calls · unresolved targets: 0 · external targets: 5.
Called byCallsNo direct callersprivate sourcelib.choir.src.dialects.memref.MemrefDialectgetFenceOrderingAttrdialects.MemrefDialect.AtomicStoreOpgetOrdering
Static calls · unresolved targets: 0 · external targets: 0.
Called byCallsNo direct callstest sourcelib.choir.src.backends.x64.backendtest: x86 64 f32 dot product looptest sourcelib.choir.src.backends.x64.backendtest: x86 64 memref alloc/free roundt...test sourcelib.choir.src.backends.x64.backendtest: x86 64 memref f32 add loadtest sourcelib.choir.src.backends.x64.backendtest: x86 64 memref i16 load/storetest sourcelib.choir.src.backends.x64.backendtest: x86 64 memref i8 load/storetest sourcelib.choir.src.backends.x64.jittest: JIT patches extern call targets...dialects.MemrefDialect.DeallocOpcreate
Static calls · unresolved targets: 0 · external targets: 4.
Called byCallsprivate sourcelib.choir.src.dialects.memrefcheckMemrefConstructorAllocationFailu...test sourcelib.choir.src.dialects.memref.test_MemrefDialectFenceOp carries scope and ordering si...test sourcelib.choir.src.dialects.memreftest: MemrefDialect atomic load and s...private sourcelib.choir.src.dialects.memref.MemrefDialectsetFenceOrderingAttrprivate sourcelib.choir.src.dialects.memref.MemrefDialectsetFenceScopeAttrdialects.MemrefDialect.FenceOpcreate
Static calls · unresolved targets: 0 · external targets: 4.
Called byCallsNo direct callersprivate sourcelib.choir.src.dialects.memref.MemrefDialectgetFenceOrderingAttrdialects.MemrefDialect.FenceOpgetOrdering
Static calls · unresolved targets: 0 · external targets: 0.
Called byCallsNo direct callersprivate sourcelib.choir.src.dialects.memref.MemrefDialectgetFenceScopeAttrdialects.MemrefDialect.FenceOpgetScope
Static calls · unresolved targets: 0 · external targets: 0.
Called byCallsprivate sourcelib.choir.src.backends.x64.jitbuildGlobalModuleprivate sourcelib.choir.src.backends.x64.jitbuildRegionModuleprivate sourcelib.choir.src.backends.x64.objectbuildRegionProbeModuletest sourcelib.choir.src.dialects.memreftest: memref global declarations and ...private sourcelib.choir.src.dialects.memref.MemrefDialectloadSpecprivate sourcelib.choir.src.dialects.memrefverifyGetGlobaldialects.MemrefDialect.GetGlobalOpcreate
Static calls · unresolved targets: 0 · external targets: 3.
Called byCallsprivate sourcelib.choir.src.backends.x64.jitbuildGlobalModuleprivate sourcelib.choir.src.backends.x64.jitbuildRegionModuleprivate sourcelib.choir.src.backends.x64.objectbuildRegionProbeModuletest sourcelib.choir.src.dialects.memref.test_MemrefDialectGlobalOp maps declarations onto the t...test sourcelib.choir.src.dialects.memref.test_MemrefDialectGlobalOp refuses a declaration no sec...test sourcelib.choir.src.dialects.memreftest: memref global declarations and ...private sourcelib.choir.src.dialects.memref.MemrefDialectloadSpecprivate sourcelib.choir.src.dialects.memrefverifyGlobaldialects.MemrefDialect.GlobalOpcreate
Static calls · unresolved targets: 0 · external targets: 6.
Called byCallsNo direct callsdialects.MemrefDialect.GlobalOpgetPlacementdialects.MemrefDialect.GlobalOpgetInitial
Static calls · unresolved targets: 0 · external targets: 2.
Called byCallsNo direct callersdialects.MemrefDialect.GlobalOpgetInitialdialects.MemrefDialect.GlobalOpisConstantdialects.MemrefDialect.GlobalOpgetPlacement
Static calls · unresolved targets: 0 · external targets: 0.
Called byCallsNo direct callsdialects.MemrefDialect.GlobalOpgetPlacementdialects.MemrefDialect.GlobalOpisConstant
Static calls · unresolved targets: 0 · external targets: 2.
Called byCallsNo direct callsprivate sourcelib.accy.src.kernel.model.core.builder.Builderloadprivate sourcelib.accy.src.kernel.model.core.builder.BuilderloadVectortiny.chantlower.memoryloadElementprivate sourcelib.choir.src.backends.gpu.cpu.loweringcloneVectorLoadprivate sourcelib.choir.src.backends.gpu.cpu.stage.LowererloadAt+47 moredialects.MemrefDialect.LoadOpcreate
Static calls · unresolved targets: 0 · external targets: 5.
Called byCallsprivate sourcelib.choir.src.dialects.memrefcheckMemrefConstructorAllocationFailu...test sourcelib.choir.src.dialects.memreftest: MemrefDialect cache attributes ...private sourcelib.choir.src.dialects.memref.MemrefDialectsetCacheEvictionAttrprivate sourcelib.choir.src.dialects.memref.MemrefDialectsetCacheOperationAttrdialects.MemrefDialect.LoadOpcreateWithCache
Static calls · unresolved targets: 1 · external targets: 1.
Called byCallsNo direct callersprivate sourcelib.choir.src.dialects.memref.MemrefDialectgetCacheEvictionAttrdialects.MemrefDialect.LoadOpgetCacheEviction
Static calls · unresolved targets: 0 · external targets: 0.
Called byCallsNo direct callersprivate sourcelib.choir.src.dialects.memref.MemrefDialectgetCacheOperationAttrdialects.MemrefDialect.LoadOpgetCacheOperation
Static calls · unresolved targets: 0 · external targets: 0.
Called byCallsNo direct callsprivate sourcelib.accy.src.kernel.model.core.builder.Builderstoretiny.chantlower.memorystoreElementprivate sourcelib.choir.src.backends.gpu.cpu.loweringcloneVectorStoreprivate sourcelib.choir.src.backends.gpu.cpu.stage.LowererstoreWordtest sourcelib.choir.src.backends.gpu.nvptx.conversiontest: nvptx conversion lowers gpu idx...+47 moredialects.MemrefDialect.StoreOpcreate
Static calls · unresolved targets: 0 · external targets: 4.
Called byCallsprivate sourcelib.choir.src.dialects.memrefcheckMemrefConstructorAllocationFailu...test sourcelib.choir.src.dialects.memreftest: MemrefDialect cache attributes ...private sourcelib.choir.src.dialects.memref.MemrefDialectsetCacheEvictionAttrprivate sourcelib.choir.src.dialects.memref.MemrefDialectsetCacheOperationAttrdialects.MemrefDialect.StoreOpcreateWithCache
Static calls · unresolved targets: 1 · external targets: 1.
Called byCallsNo direct callersprivate sourcelib.choir.src.dialects.memref.MemrefDialectgetCacheEvictionAttrdialects.MemrefDialect.StoreOpgetCacheEviction
Static calls · unresolved targets: 0 · external targets: 0.
Called byCallsNo direct callersprivate sourcelib.choir.src.dialects.memref.MemrefDialectgetCacheOperationAttrdialects.MemrefDialect.StoreOpgetCacheOperation
Static calls · unresolved targets: 0 · external targets: 0.
Called byCallsNo direct callstest sourcelib.choir.src.dialects.memreftest: MemrefDialect subview/transpose...dialects.MemrefDialect.SubviewOpcreate
Static calls · unresolved targets: 0 · external targets: 5.
Called byCallsNo direct callersprivate sourcelib.choir.src.dialects.memref.MemrefDialectgetLayoutPayloaddialects.MemrefDialect.SubviewOpgetOffsetPayload
Static calls · unresolved targets: 0 · external targets: 0.
Called byCallsNo direct callersprivate sourcelib.choir.src.dialects.memref.MemrefDialectgetLayoutPayloaddialects.MemrefDialect.SubviewOpgetShapePayload
Static calls · unresolved targets: 0 · external targets: 0.
Called byCallsNo direct callersprivate sourcelib.choir.src.dialects.memref.MemrefDialectgetLayoutPayloaddialects.MemrefDialect.SubviewOpgetStridePayload
Static calls · unresolved targets: 0 · external targets: 0.
Called byCallsNo direct callstest sourcelib.choir.src.dialects.memreftest: MemrefDialect subview/transpose...dialects.MemrefDialect.TransposeOpcreate
Static calls · unresolved targets: 0 · external targets: 5.
Called byCallsNo direct callersprivate sourcelib.choir.src.dialects.memref.MemrefDialectgetLayoutPayloaddialects.MemrefDialect.TransposeOpgetShapePayload
Static calls · unresolved targets: 0 · external targets: 0.
Called byCallsNo direct callersprivate sourcelib.choir.src.dialects.memref.MemrefDialectgetLayoutPayloaddialects.MemrefDialect.TransposeOpgetStridePayload
Static calls · unresolved targets: 0 · external targets: 0.
Called byCallsprivate sourcelib.choir.src.backends.x64.jitbuildRegionModuletest sourcelib.choir.src.dialects.memref.test_MemrefDialectViewOp offsets a byte base and refuse...private sourcelib.choir.src.dialects.memrefverifyViewdialects.MemrefDialect.ViewOpcreate
Static calls · unresolved targets: 0 · external targets: 6.
Called byCallsprivate sourcelib.accy.src.kernel.model.core.builder.BuilderdynamicSharedBufferprivate sourcelib.accy.src.kernel.model.core.builder.BuildersharedBufferprivate sourcelib.accy.src.kernel.model.core.builderbufferTypetiny.chantlower.memoryallocaScalartest sourcelib.choir.src.backends.gpu.featurestest: target features infer async cop...+37 moredialects.MemrefDialectgetMemrefType1DWithAttrsdialects.MemrefDialectgetMemrefType1D
Static calls · unresolved targets: 0 · external targets: 0.
Called byCallstiny.chantlower.memoryallocaObjectprivate sourcelib.choir.src.backends.gpu.cpu.loweringcpuBoundaryTypeprivate sourcelib.choir.src.backends.gpu.cpu.stage.LowererlowerOperationdialects.MemrefDialectgetMemrefType1Dtest sourcelib.choir.src.dialects.memreftest: MemrefDialect type attributesprivate sourcelib.choir.src.dialects.memref.MemrefDialectappendTypeAttrsprivate sourcelib.choir.src.dialects.memref.MemrefDialectloadSpecdialects.MemrefDialectgetMemrefType1DWithAttrs
Static calls · unresolved targets: 0 · external targets: 4.
Called byCallsprivate sourcelib.accy.src.kernel.model.core.builderbufferTypetiny.chantlower.convertvalueTypebackends.gpu.cpu.stagelowerStagesToHosttest sourcelib.choir.src.backends.gpu.featurestest: target features classify f32 at...test sourcelib.choir.src.backends.gpu.featurestest: target features infer atomics f...+37 moredialects.MemrefDialectgetMemrefTypeDynamicWithAttrsdialects.MemrefDialectgetMemrefTypeDynamic
Static calls · unresolved targets: 0 · external targets: 0.
Called byCallsprivate sourcelib.choir.src.backends.gpu.cpu.loweringcpuBoundaryTypedialects.MemrefDialectgetMemrefTypeDynamicprivate sourcelib.choir.src.dialects.memref.MemrefDialectappendTypeAttrsprivate sourcelib.choir.src.dialects.memref.MemrefDialectloadSpecdialects.MemrefDialectgetMemrefTypeDynamicWithAttrs
Static calls · unresolved targets: 0 · external targets: 4.
Called byCallsprivate sourcelib.accy.src.preparation.kernelization.model....dynamicSharedMemrefParamsprivate sourcelib.choir.src.backends.gpu.cpu.stage.LowererlowerOperationprivate sourcelib.choir.src.backends.gpu.featuresmemrefParamsprivate sourcelib.choir.src.backends.gpu.metal.mslmemrefInfoprivate sourcelib.choir.src.backends.gpu.nvptx.conversionmemrefAddressSpace+12 moredialects.AddressSpacefromStringdialects.memref.IndexingfromStringdialects.MemrefDialectparseMemrefParams
Static calls · unresolved targets: 0 · external targets: 3.
Called byCallstest sourcelib.choir.src.dialects.memreftest: MemrefDialect subview/transpose...private sourcelib.choir.src.dialects.memref.MemrefDialectsetLayoutDimsAttrprivate sourcelib.choir.src.dialects.memref.MemrefDialectsetLayoutOffsetAttrdialects.MemrefDialectsetLayoutAttrs
Static calls · unresolved targets: 0 · external targets: 0.

Also reachable as

dialects.MemrefDialect.

Complete caller list for dialects.MemrefDialect.AllocOp.createDynamic

8 direct callers.

Complete caller list for dialects.MemrefDialect.AllocOp.createStatic

25 direct callers.

Complete caller list for dialects.MemrefDialect.AtomicRmwOp.create

9 direct callers.

Complete caller list for dialects.MemrefDialect.LoadOp.create

52 direct callers.

Complete caller list for dialects.MemrefDialect.StoreOp.create

52 direct callers.

Complete caller list for dialects.MemrefDialect.getMemrefType1D

42 direct callers.

Complete caller list for dialects.MemrefDialect.getMemrefTypeDynamic

42 direct callers.

Complete caller list for dialects.MemrefDialect.parseMemrefParams

17 direct callers.

Audit

Definitions153
Public names306
Members42
Version26.7.0
Revisiondaab053ee433