[code-reflection] RFR: Minor logging changes for HAT ModuleOp support

Ruby Chen duke at openjdk.org
Tue Aug 12 17:06:11 UTC 2025


Add more descriptive logs for ModuleOp backend in HAT.

To use the ModuleOp backend, pass `moduleOp` as an arg to the `hat/run.java` script when running a HAT example. For example, running the `mandel` example with the `ffi-opencl` backend and `moduleOp` enabled can be done with 

java @hat/run moduleOp ffi-opencl squares

Adding `moduleOp` sets `-DmoduleOp=true` and passes it to the backend, which uses the flag to choose between the original `CallGraph` implementation and the new `moduleOp` implementation.

`ModuleOpWrapper` now contains `createTransitiveInvokeModule()`, which creates a `ModuleOp` representing a call graph when given an entrypoint. This method is called in `KernelCallGraph` and `ComputeCallGraph` to generate their respective call graphs. The kernel and compute call graph classes also maintain a map of buffer accesses, along with structures storing other useful methods.

The `C99FFIBackend`, `CudaBackend`, `MockBackend`, and `C99HATKernelBuilder` access call graphs structures differently depending on the `moduleOp` flag.

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

Commit messages:
 - Fix naming for ModuleOp stdout logs
 - Add error messages and output mode to stdout

Changes: https://git.openjdk.org/babylon/pull/521/files
  Webrev: https://webrevs.openjdk.org/?repo=babylon&pr=521&range=00
  Stats: 13 lines in 5 files changed: 10 ins; 0 del; 3 mod
  Patch: https://git.openjdk.org/babylon/pull/521.diff
  Fetch: git fetch https://git.openjdk.org/babylon.git pull/521/head:pull/521

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


More information about the babylon-dev mailing list