Lines Matching refs:rewrite

120 a list of constraints specified after the rewrite dag. For very simple patterns
188 potentially add another special rewrite directive, or extend `replaceWithValue`,
283 // - Last statement starts the rewrite.
297 section and the `rewrite` section. The `match` section of a pattern describes
298 the expected input IR, whereas the `rewrite` section describes how to transform
304 The general layout of the `match` and `rewrite` section is as follows: the
306 [`operation rewrite statement`](#operation-rewrite-statements), and denotes the
307 `rewrite` section; every statement before denotes the `match` section.
312 certain behaviors, and providing information to the rewrite driver applying the
369 [operation rewrite statement](#operation-rewrite-statements):
398 expression or to a non-native constraint or rewrite use within the `match` section of the
400 input (i.e. `match` section) or output (i.e. `rewrite` section) IR. In the `match` section,
402 "bound" to the [operation rewrite statement](#operation-rewrite-statements) that denotes the
403 `rewrite` section of the pattern. All non-root variables within the `match`
424 // ** rewrite section ** //
434 of the `rewrite` section of the pattern. Writing this pattern using the C++ API, the concept
460 // ** rewrite section ** //
552 the pattern. In the `rewrite` section of the pattern, this expression models one
567 constraints of the operation. In the `rewrite` section, the name is required.
581 that the operands are not constrained in any way. If elided within a `rewrite`
618 that the result types are not constrained in any way. If elided within a `rewrite`
653 Within the `rewrite` section of a pattern, the result types of an
678 rewrite root: Op with {
696 rewrite root: Op with {
864 [rewrite](#rewrites-with-multiple-results).
1270 Rewriters define the set of transformations to be performed within the `rewrite`
1273 `rewrite` section of the pattern. The `rewrite` section is denoted by the last
1275 [operation rewrite statement](#operation-rewrite-statements). There are two main
1276 categories of rewrites in PDLL: operation rewrite statements, and user defined
1281 Operation rewrite statements are builtin PDLL statements that perform an IR
1283 to start the `rewrite` section of a pattern, as they allow for properly
1327 ##### `rewrite` statement
1333 rewrite root with {
1341 The `rewrite` statement allows for rewriting a given root operation with a block
1343 and any transformations to it must be expressed within the nested rewrite block.
1344 The inner body may contain any number of other rewrite statements, variables, or
1350 rewrite fragments that can be composed across many different patterns. A
1353 and a body. Results of a rewrite are returned via a `return` statement. A few
1357 // A rewrite that constructs and returns a new operation, given an input value.
1363 // We invoke the rewrite in the same way as functions in traditional
1377 // A rewrite that returns multiple results, with some of the results assigned
1384 rewrite root: Op<my_dialect.foo> with {
1385 // Invoke the rewrite, which returns a tuple of values.
1396 In addition to explicitly specifying the results of the rewrite via the rewrite
1398 return statement. Result type inference is active whenever the rewrite is
1402 // This rewrite returns a derived operation.
1404 // This rewrite returns a tuple of two Values.
1410 rewrite root: Op<my_dialect.foo> with {
1434 [operation rewrite statement](#operation-rewrite-statements):
1449 rewrite "declaration". This is similar to the PDLL form of defining a
1450 rewrite but omits the body. Importing the declaration in this form allows for
1454 // Import a single input native rewrite that returns a new operation. This
1455 // rewrite must be registered by the consumer of the compiled PDL.
1464 the C++ PDL API. For example, the rewrite above may be registered as:
1468 // insert special rewrite logic here.
1482 be defined by specifying a string code block after the rewrite declaration:
1491 rewrite root with {
1492 // Invoke the native rewrite and use the results when replacing the root.
1499 The arguments of the rewrite are accessible within the code block via the
1500 same name. See the ["type translation"](#native-rewrite-type-translations) below for
1503 `rewriter`. See the ["result translation"](#native-rewrite-result-translation) section
1506 Taking the rewrite defined above as an example, this function would roughly be
1525 The results of a native rewrite are directly translated to the results of the native function,
1526 using the type translation rules [described above](#native-rewrite-type-translations). The section