The cheapest chains of conversions between two non-terminals: their costs and each one's first conversion. More...
#include <mim/plug/mach/rule_table.h>
Public Member Functions | |
| constexpr | Chains (const auto &conversions) |
The closure of conversions, a range of Conversion-like rules with from, to, and cost. | |
| constexpr std::pair< Ty, u32 > | target (Ty from, Want want) const |
The non-terminal that from converts to most cheaply for a hole of type want, and the cost. | |
| constexpr u32 | conv (Ty from, Want want) const |
Cost of converting a replacement or operand of non-terminal from into a hole of type want. | |
| constexpr bool | total (Want w) const |
Does every non-terminal of w's register class convert into a hole of type w, as an atomic rule's holes must? | |
| constexpr bool | reachable (Want w) const |
Does some non-terminal of the register class of a rule convert into a hole of type w? | |
Public Attributes | |
| std::array< std::array< u32, Num_Tys >, Num_Tys > | cost {} |
| std::array< std::array< u32, Num_Tys >, Num_Tys > | first {} |
| std::array< bool, Num_Tys > | used {} |
| The non-terminals of the backend: Reg, Lit, and those its conversions mention. | |
The cheapest chains of conversions between two non-terminals: their costs and each one's first conversion.
Definition at line 163 of file rule_table.h.
|
inlineconstexpr |
The closure of conversions, a range of Conversion-like rules with from, to, and cost.
Definition at line 170 of file rule_table.h.
References mim::plug::mach::rules::add(), cost, first, mim::plug::mach::rules::Inf, mim::plug::mach::rules::Num_Tys, and used.
Cost of converting a replacement or operand of non-terminal from into a hole of type want.
Definition at line 197 of file rule_table.h.
References mim::plug::mach::rules::Inf, mim::plug::mach::rules::is_literal(), and target().
Referenced by reachable(), and total().
|
inlineconstexpr |
Does some non-terminal of the register class of a rule convert into a hole of type w?
Definition at line 211 of file rule_table.h.
References conv(), mim::plug::mach::rules::Inf, mim::plug::mach::rules::Num_Tys, and mim::plug::mach::rules::same_class().
|
inlineconstexpr |
The non-terminal that from converts to most cheaply for a hole of type want, and the cost.
Definition at line 189 of file rule_table.h.
References cost, mim::plug::mach::rules::fills(), mim::plug::mach::rules::Inf, and mim::plug::mach::rules::Num_Tys.
Referenced by conv().
|
inlineconstexpr |
Does every non-terminal of w's register class convert into a hole of type w, as an atomic rule's holes must?
Definition at line 204 of file rule_table.h.
References conv(), mim::plug::mach::rules::Inf, mim::plug::mach::rules::Num_Tys, mim::plug::mach::rules::same_class(), and used.
Definition at line 164 of file rule_table.h.
Definition at line 165 of file rule_table.h.
Referenced by Chains().
| std::array<bool, Num_Tys> mim::plug::mach::rules::Chains::used {} |