[all-commits] [llvm/llvm-project] f79f50: [mlir][acc] Add OffloadLiveInValueCanonicalization...
Razvan Lupusoru via All-commits
all-commits at lists.llvm.org
Thu Jan 8 13:05:26 PST 2026
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: f79f50cd547d0582af15aebd3a0413136b9311ae
https://github.com/llvm/llvm-project/commit/f79f50cd547d0582af15aebd3a0413136b9311ae
Author: Razvan Lupusoru <razvan.lupusoru at gmail.com>
Date: 2026-01-08 (Thu, 08 Jan 2026)
Changed paths:
M flang/include/flang/Optimizer/OpenACC/Support/FIROpenACCOpsInterfaces.h
M flang/lib/Optimizer/OpenACC/Support/CMakeLists.txt
M flang/lib/Optimizer/OpenACC/Support/FIROpenACCOpsInterfaces.cpp
M flang/lib/Optimizer/OpenACC/Support/RegisterOpenACCExtensions.cpp
A flang/test/Fir/CUDA/cuf-offload-livein-value-canonicalization.fir
A flang/test/Fir/OpenACC/offload-livein-value-canonicalization.fir
M mlir/include/mlir/Dialect/OpenACC/OpenACCBase.td
M mlir/include/mlir/Dialect/OpenACC/OpenACCOps.td
M mlir/include/mlir/Dialect/OpenACC/OpenACCOpsInterfaces.td
M mlir/include/mlir/Dialect/OpenACC/Transforms/Passes.td
M mlir/lib/Dialect/OpenACC/IR/CMakeLists.txt
M mlir/lib/Dialect/OpenACC/IR/OpenACC.cpp
M mlir/lib/Dialect/OpenACC/Transforms/CMakeLists.txt
A mlir/lib/Dialect/OpenACC/Transforms/OffloadLiveInValueCanonicalization.cpp
A mlir/test/Dialect/OpenACC/offload-livein-value-canonicalization.mlir
Log Message:
-----------
[mlir][acc] Add OffloadLiveInValueCanonicalization pass (#174671)
Introduce a pass to canonicalize live-in values for regions that will be
outlined for device execution.
When a region is outlined, values defined outside but used inside become
arguments to the outlined function. However, some values cannot or
should not be passed as arguments:
- Synthetic types (shape metadata, field indices)
- Constants better recreated inside the region
- Address-of operations for device-resident globals
This pass identifies such values and either sinks the defining operation
into the region (when all uses are inside) or clones it inside (when
uses exist both inside and outside).
To identify target regions in a dialect-agnostic way, this patch
introduces `OffloadRegionOpInterface`. This marker interface allows the
pass to work uniformly across OpenACC compute constructs, GPU
operations, and other offload dialects without hardcoding operation
types. The interface is attached to `acc.parallel`, `acc.kernels`, and
`acc.serial` directly through TableGen. It is also being attached to
`gpu.launch` and `cuf.kernel`, the latter through the FIR OpenACC
extensions.
The pass leverages existing interfaces for candidate detection:
`OutlineRematerializationOpInterface` marks operations producing
non-argument-passable values, while `ViewLikeOpInterface` and
`PartialEntityAccessOpInterface` allow tracing through casts and views
to find original defining operations. OpenACCSupport analysis provides
symbol validation for address-of operations.
To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications
More information about the All-commits
mailing list