llvm-project/mlir/lib/TableGen
Lei Zhang 48a6aa6c51 [TableGen] Better support for predicate and rewrite rule specification
Currently predicates are written with positional placeholders `{N}` and rely on
    `formatv` as the engine to do substitution. The problem with this approach is that
    the definitions of those positional placeholders are not consistent; they are
    entirely up to the defining predicate of question. For example, `{0}` in various
    attribute constraints is used to mean the attribute, while it is used to main the
    builder for certain attribute transformations. This can become very confusing.

    This CL introduces `tgfmt` as a new mechanism to better support for predicate and
    rewrite rule specification. Instead of entirely relying on positional placeholders,
    `tgfmt` support both positional and special placeholders. The former is used for
    DAG operands. The latter, including $_builder, $_op, $_self, are used as special
    "hooks" to entities in the context. With this, the predicate and rewrite rules
    specification can be more consistent is more readable.

--

PiperOrigin-RevId: 243249671
2019-04-18 11:47:27 -07:00
..
Argument.cpp Change Value to NamedTypeConstraint and use TypeConstraint. 2019-03-29 17:22:51 -07:00
Attribute.cpp Add methods for building array attributes in Builder 2019-04-07 18:19:56 -07:00
CMakeLists.txt [TableGen] Better support for predicate and rewrite rule specification 2019-04-18 11:47:27 -07:00
Constraint.cpp [TableGen] Consolidate constraint related concepts 2019-03-29 17:38:46 -07:00
Format.cpp [TableGen] Better support for predicate and rewrite rule specification 2019-04-18 11:47:27 -07:00
OpTrait.cpp Add a trait to set the result type by attribute 2019-03-29 17:43:06 -07:00
Operator.cpp [TableGen] Rework verifier generation and error messages 2019-04-05 07:40:31 -07:00
Pattern.cpp [TableGen] Make sure op in pattern has the same number of arguments as definition 2019-04-08 19:17:56 -07:00
Predicate.cpp [TableGen] Support array attribute subclasses and constraints 2019-04-05 07:43:32 -07:00
Type.cpp [TableGen] Consolidate constraint related concepts 2019-03-29 17:38:46 -07:00