Thorin
1.9.0
The Higher ORder INtermediate representation
Loading...
Searching...
No Matches
affine.h
Go to the documentation of this file.
1
#pragma once
2
3
#include "
thorin/world.h
"
4
5
#include "
thorin/plug/affine/autogen.h
"
6
7
namespace
thorin::plug::affine
{
8
9
/// @name %%affine.For
10
///@{
11
/// Returns the affine_for axiom applied with \a params.
12
/// See documentation for %affine.For axiom in @ref affine.
13
inline
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.
19
// clang-format off
20
inline
const
Def
*
op_for
(
World
& w,
21
Ref
begin,
22
Ref
end,
23
Ref
step,
24
Defs
inits,
25
Ref
body,
26
Ref
brk) {
27
auto
types =
DefVec
(inits.size(), [&](
size_t
i) { return inits[i]->type(); });
28
return
w.app(
fn_for
(w, types), {begin, end, step, w.tuple(inits), body, brk});
29
}
30
// clang-format on
31
///@}
32
33
}
// namespace thorin::plug::affine
autogen.h
thorin::Def
Base class for all Defs.
Definition
def.h:222
thorin::Ref
Helper class to retrieve Infer::arg if present.
Definition
def.h:87
thorin::Span
This is a thin wrapper for std::span<T, N> with the following additional features:
Definition
span.h:28
thorin::World
The World represents the whole program and manages creation of Thorin nodes (Defs).
Definition
world.h:35
thorin::plug::affine
The affine Plugin
Definition
affine.h:7
thorin::plug::affine::op_for
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:20
thorin::plug::affine::fn_for
const Def * fn_for(World &w, Defs params)
Definition
affine.h:13
thorin::plug::affine::For
For
Definition
autogen.h:15
thorin::DefVec
Vector< const Def * > DefVec
Definition
def.h:63
world.h
include
thorin
plug
affine
affine.h
Generated by
1.9.8