Posts, notes, and experiments.

How REX Outlines Device Kernels


A focused walkthrough of the outlining stage in REX GPU lowering: how target bodies become device kernels, how capture sets are classified, and why loop lowering happens after outlining.
Read more ⟶

How REX Dispatches GPU Offloading Constructs


A focused walkthrough of the first stage inside the GPU lowerer: how REX routes many `SgOmpTarget*` surface constructs into a small number of core lowering paths, and why that dispatch boundary keeps the compiler generic.
Read more ⟶

How REX Tests OpenMP End to End


A deep look at the layered OpenMP test system in REX: parser tests, frontend compile and analyzer tests, invariant-based lowering checks, CPU equivalence, and full benchmark validation.
Read more ⟶

Why REX Does Not Let Clang Own the OpenMP AST


An architectural deep dive into one of the central REX design choices: why a ROSE/Sage source-to-source compiler cannot treat Clang's OpenMP AST as the source of truth, and why OpenMP has to become `SgOmp*` inside REX instead.
Read more ⟶

How REX Carries OpenMP Pragmas Before AST Construction


A focused walkthrough of Stage 1 in the REX OpenMP pipeline: `processOpenMP()`, clause normalization control, raw directive text recovery, C/C++ pragma parsing, Fortran comment handling, and the handoff into OpenMPIR.
Read more ⟶

How OpenMP AST Construction Works in REX: OpenMPIR to SgOmp*


A focused walkthrough of Stage 2 in the REX OpenMP pipeline: converting ompparser's OpenMPIR into Sage/ROSE `SgOmp*` nodes with correct nesting, clause structure, and scope-aware expression parsing.
Read more ⟶

Surviving LLVM Offload ABI Drift in REX


When LLVM offloading changes, a source-to-source compiler can keep building but stop running. This post explains the failure modes, the debugging workflow, and the compatibility strategy REX uses to stay stable across LLVM toolchain migrations.
Read more ⟶

How Offloading Runtime Glue Works in REX


A deep look at the REX helper/runtime boundary: how offload entries are emitted, how a CUBIN image is registered with libomptarget, how rex_kmp.h rewrites runtime calls, and why init/fini are handled the way they are.
Read more ⟶

How GPU Offloading Lowering Works in REX


A deep walkthrough of the REX OpenMP GPU lowerer: directive dispatch, outlining, runtime map arrays, `__tgt_kernel_arguments` construction, generated files, and the tests that keep multi-kernel lowering correct.
Read more ⟶

How OpenMP Works in REX: From Pragmas to GPU Kernels


An end-to-end walkthrough of REX's OpenMP architecture: why it owns OpenMP parsing, how ompparser feeds Sage AST construction, how lowering generates host and device code, and how the test system keeps the pipeline honest.
Read more ⟶