[all-commits] [llvm/llvm-project] f84257: [flang][OpenMP][Lower] fix statement context clean...
Tom Eccles via All-commits
all-commits at lists.llvm.org
Tue Apr 1 02:41:17 PDT 2025
Branch: refs/heads/users/tblah/array-sections-01-stmtctx
Home: https://github.com/llvm/llvm-project
Commit: f842579fa10cee4eb28654ef45a80934734ddf44
https://github.com/llvm/llvm-project/commit/f842579fa10cee4eb28654ef45a80934734ddf44
Author: Tom Eccles <tom.eccles at arm.com>
Date: 2025-04-01 (Tue, 01 Apr 2025)
Changed paths:
M flang/lib/Lower/OpenMP/OpenMP.cpp
Log Message:
-----------
[flang][OpenMP][Lower] fix statement context cleanup insertion point
The statement context is used for lowering clauses for openmp
operations using generalised helpers from flang lowering. The statement
context stores closures which generate code for cleaning up temporary
values generated by the lowering helper. These closures are run when the
statement construct is destroyed. Keeping the statement context local to
the clause or operation being lowered without any special handling was
not correct because any cleanup code would be generated at the insertion
point when that statement context went out of scope (which would in
general be inside of the newly created container operation). It would be
better to generate the cleanup code after the newly created operation
(clause processing is synchronous even for deferred tasks).
Currently supported clauses are mostly populated with simple scalar values
that require no cleanup. Even the simple array sections added by #132994
needed no cleanup because indexing the right values of the array did not
create any temporaries. Supporting array sections with vector indexing
will generate hlfir.destroy operations for cleanup. This patch fixes
where those will be created. Those hlfir.destroy operations don't
generate any FIR (or LLVM) code, but the issue still exists
theoretically.
I wasn't able to find any clauses which have any cleanup to use to test
this PR. It is probably NFC for the current lowering. This will be
tested in the PR adding vector subscripting of array sections.
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