[code-reflection] RFR: Normalize blocks transformer [v2]

Paul Sandoz psandoz at openjdk.org
Mon Sep 23 21:26:10 UTC 2024


> 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.

Paul Sandoz has updated the pull request incrementally with one additional commit since the last revision:

  Use different values

-------------

Changes:
  - all: https://git.openjdk.org/babylon/pull/238/files
  - new: https://git.openjdk.org/babylon/pull/238/files/686e94f7..44395537

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=babylon&pr=238&range=01
 - incr: https://webrevs.openjdk.org/?repo=babylon&pr=238&range=00-01

  Stats: 2 lines in 1 file changed: 0 ins; 0 del; 2 mod
  Patch: https://git.openjdk.org/babylon/pull/238.diff
  Fetch: git fetch https://git.openjdk.org/babylon.git pull/238/head:pull/238

PR: https://git.openjdk.org/babylon/pull/238


More information about the babylon-dev mailing list