MimIR
MimIR is my Intermediate Representation
Loading...
Searching...
No Matches
isel.h File Reference
#include <optional>
#include <span>
#include <pbqp/graph.h>
#include <mim/driver.h>
#include <mim/phase.h>
#include "mim/plug/mach/rule_table.h"
#include "mim/plug/mach/target.h"
Include dependency graph for isel.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  mim::plug::mach::Demand
 What a match needs of the operand def: a hole of type want or, if inner is set, that inner pattern node. More...
struct  mim::plug::mach::Cover
 An inner node a match covers, with what it needs of its own operands. More...
struct  mim::plug::mach::Alt
 An alternative of a PBQP node: a match rooted there, or the class of all matches covering it as the same inner node. More...
class  mim::plug::mach::ISel
 Rewrites the core, mach, and math operations of a world that mach.legalize lowered into the instructions of a backend by the rules of its generated rules::Table. More...

Namespaces

namespace  mim
namespace  mim::plug
namespace  mim::plug::mach
 The mach Plugin

Functions

Phase * mim::plug::mach::mim_mach_isel (World &, flags_t annex, const rules::Table &table)
 A new ISel for the annex annex of a backend, with the rules table; compiled once into libmim_mach.
template<class A>
void mim::plug::mach::hook_isel (Flags2Phases &phases, const rules::Table &table)
 Registers ISel with the rules table as the Phase of the backend's annex A.

Rules

A rule rewrites a pattern over core/mach/math into a backend's term; the holes of the pattern are typed.

using mim::plug::mach::Alts = fe::Vector<Alt>
enum class  mim::plug::mach::Ty
 The non-terminal a rule yields by the type of its rhs: a register of either class, an address without/with an index, [I64, I2], or a register that holds its value zero-extended. More...
enum class  mim::plug::mach::Want
 What a rule wants of the term a meta variable matches; a Param is bound but no operand. More...

Class Documentation

◆ mim::plug::mach::Cover

struct mim::plug::mach::Cover

An inner node a match covers, with what it needs of its own operands.

Definition at line 35 of file isel.h.

Class Members
const Def * def
Vector< Demand > demands
size_t inner = 0
bool through = false The match only looks through it, since something else uses it.

◆ mim::plug::mach::Alt

struct mim::plug::mach::Alt

An alternative of a PBQP node: a match rooted there, or the class of all matches covering it as the same inner node.

Definition at line 43 of file isel.h.

Class Members
u32 copies = 0 The operands its two-address instructions overwrite although something else uses them.
Vector< Cover > covers
Vector< Demand > demands
DefVec metas What the meta variables of its rule match.
const Rewrite * rule = nullptr nullptr for an inner alternative, whose id is its index plus one.