9class Sigma :
public Def,
public Setters<Sigma> {
21 Sigma*
set(
size_t i,
const Def* def) {
return Def::set(i, def)->as<Sigma>(); }
50class Tuple :
public Def,
public Setters<Tuple> {
68class Arr :
public Def,
public Setters<Arr> {
78 const Def*
shape()
const {
return op(0); }
79 const Def*
body()
const {
return op(1); }
115class Pack :
public Def,
public Setters<Pack> {
125 const Def*
body()
const {
return op(0); }
155class Extract :
public Def,
public Setters<Extract> {
181class Insert :
public Def,
public Setters<Insert> {
184 : Def(
Node,
tuple->type(), {tuple, index, value}, 0) {}
A (possibly paramterized) Array.
const Def * immutabilize() override
Tries to make an immutable from a mutable.
static constexpr auto Node
const Def * rebuild_(World &, const Def *, Defs) const override
Arr * set_body(const Def *body)
Arr * set_shape(const Def *shape)
const Def * shape() const
const Def * check() override
Arr * stub_(World &, const Def *) override
const Def * reduce(const Def *arg) const
Arr * stub(const Def *type)
Def * set(size_t i, const Def *)
Successively set from left to right.
World & world() const noexcept
constexpr auto ops() const noexcept
const Def * op(size_t i) const noexcept
DefVec reduce(const Def *arg) const
Rewrites Def::ops by substituting this mutable's Var with arg.
const Def * type() const noexcept
Yields the "raw" type of this Def (maybe nullptr).
Def * unset()
Unsets all Def::ops; works even, if not set at all or partially.
const Def * rebuild_(World &, const Def *, Defs) const override
static constexpr auto Node
const Def * tuple() const
const Def * index() const
const Def * value() const
A (possibly paramterized) Tuple.
Pack * reset(const Def *body)
const Def * rebuild_(World &, const Def *, Defs) const override
const Def * shape() const
const Def * reduce(const Def *arg) const
const Def * immutabilize() override
Tries to make an immutable from a mutable.
static constexpr auto Node
Pack * set(const Def *body)
Pack * stub_(World &, const Def *) override
Pack * stub(const Def *type)
CRTP-based Mixin to declare setters for Def::loc & Def::name using a covariant return type.
const Def * immutabilize() override
Tries to make an immutable from a mutable.
Sigma * stub(const Def *type)
const Def * rebuild_(World &, const Def *, Defs) const override
Sigma * stub_(World &, const Def *) override
static const Def * infer(World &, Defs)
const Def * check() override
static constexpr auto Node
Sigma * set(size_t i, const Def *def)
static const Def * infer(World &, Defs)
const Def * rebuild_(World &, const Def *, Defs) const override
static constexpr auto Node
The World represents the whole program and manages creation of MimIR nodes (Defs).
const Def * flatten(const Def *def)
Flattens a sigma/array/pack/tuple.
Vector< const Def * > DefVec
bool is_unit(const Def *)
const Def * merge_sigma(const Def *def, Defs defs)
std::string tuple2str(const Def *)
const Def * unflatten(const Def *def, const Def *type)
Applies the reverse transformation on a Pack / Tuple, given the original type.
const Def * tuple_of_types(const Def *t)
const Def * merge_tuple(const Def *def, Defs defs)