[code-reflection] Integrated: Normalize blocks transformer
Paul Sandoz
psandoz at openjdk.org
Wed Sep 25 23:28:54 UTC 2024
On Fri, 20 Sep 2024 23:26:11 GMT, Paul Sandoz <psandoz at openjdk.org> wrote:
> A model transformer that normalizes blocks. Merges redundant blocks with their predecessors, those which are unconditionally branched to and have only one predecessor. Removes unused block parameters.
>
> This is useful to normalize models that have been lowered or lifted and contain redundant blocks.
>
> --
>
> Observation: transformers can be stateless or stateful. Currently for the latter we cannot expose an `OpTransformer` instance since it can really only be used once it it accumulates state that may be incorrect on subsequent transformations. What may be required is the concept of a transformer that provides two or more methods that return functional interfaces for separate aspects (like `Collector` or `Gatherer`), such as a function to produce a state object, and a function to transform given that state object. The state object might be produced by traversing the model before it is transformed. Something to consider later in a refactoring of this API.
This pull request has now been integrated.
Changeset: e7b1d158
Author: Paul Sandoz <psandoz at openjdk.org>
URL: https://git.openjdk.org/babylon/commit/e7b1d158fc2b6279cddf27f88707d556c72bb764
Stats: 416 lines in 4 files changed: 415 ins; 0 del; 1 mod
Normalize blocks transformer
-------------
PR: https://git.openjdk.org/babylon/pull/238
More information about the babylon-dev
mailing list