MimIR 0.1
MimIR is my Intermediate Representation
Loading...
Searching...
No Matches
affine.h
Go to the documentation of this file.
1#pragma once
2
3#include "mim/world.h"
4
6
8
9/// @name %%affine.For
10/// Returns the affine_for axiom applied with \a params.
11/// See documentation for %affine.For axiom in @ref affine.
12///@{
13inline const Def* fn_for(World& w, Defs params) {
14 return w.app(w.annex<affine::For>(), {w.lit_i32(), w.lit_nat(params.size()), w.tuple(params)});
15}
16
17/// Returns a fully applied affine_for axiom.
18/// See documentation for %affine.For axiom in @ref affine.
19inline const Def* op_for(World& w, Ref begin, Ref end, Ref step, Defs inits, Ref body, Ref brk) {
20 auto types = DefVec(inits.size(), [&](size_t i) { return inits[i]->type(); });
21 return w.app(fn_for(w, types), {begin, end, step, w.tuple(inits), body, brk});
22}
23///@}
24
25} // namespace mim::plug::affine
Base class for all Defs.
Definition def.h:223
Helper class to retrieve Infer::arg if present.
Definition def.h:86
This is a thin wrapper for std::span<T, N> with the following additional features:
Definition span.h:28
The World represents the whole program and manages creation of MimIR nodes (Defs).
Definition world.h:33
The affine Plugin
Definition affine.h:7
const Def * op_for(World &w, Ref begin, Ref end, Ref step, Defs inits, Ref body, Ref brk)
Returns a fully applied affine_for axiom.
Definition affine.h:19
const Def * fn_for(World &w, Defs params)
Definition affine.h:13
Vector< const Def * > DefVec
Definition def.h:62