[flang-commits] [flang] [mlir] [Flang][mlir][OpenMP] Support affinity clause codegen in Flang (PR #182222)
Tom Eccles via flang-commits
flang-commits at lists.llvm.org
Fri Feb 27 10:40:35 PST 2026
================
@@ -921,102 +921,133 @@ mlir::Value genAffinityAddr(Fortran::lower::AbstractConverter &converter,
const omp::Object &object,
Fortran::lower::StatementContext &stmtCtx,
mlir::Location loc) {
- // Get address from expression if it exists: affinity(a(3)), affinity(a(1:10))
+ fir::FirOpBuilder &builder = converter.getFirOpBuilder();
+
+ auto genRawAddress = [&](mlir::Value v) -> mlir::Value {
+ // Only wrap with hlfir::Entity if it is a Fortran entity (avoids asserts).
----------------
tblah wrote:
Off the top of my head, I think any extended value or mapped symbol should work as an Entity (an extended value is kind of the FIR equivalent of a hlfir::Entity; mapped symbols should have a hlfir.declare). Do you have written down which asserts you encountered? I wonder if there's a subtle bug there.
But equally this does seem sensible, I know from experience that it is quite easy to stumble into these asserts.
https://github.com/llvm/llvm-project/pull/182222
More information about the flang-commits
mailing list