-
Notifications
You must be signed in to change notification settings - Fork 11.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This is a PoC for delayed privatization in OpenMP. Instead of directly emitting privatization code in the frontend, we add a new op to outline the privatization logic for a symbol and call-like mapping that maps from the host symbol to a block argument in the OpenMP region. Example: ``` !$omp target private(x) !$end omp target ``` Would be code-generated by flang as: ``` func.func @foo() { omp.target x.privatizer %x -> %argx: !fir.ref<i32> { bb0(%argx: !fir.ref<i32>): // ... use %argx .... } } "omp.private"() <{function_type = (!fir.ref<i32>) -> !fir.ref<i32>, sym_name = "x.privatizer"}> ({ ^bb0(%arg0: !fir.ref<i32>): %0 = fir.alloca i32 {bindc_name = "x", pinned, uniq_name = "_QFprivate_clause_allocatableEx"} %1 = fir.load %arg0 : !fir.ref<i32> fir.store %1 to %0 : !fir.ref<i32> omp.yield(%0 : !fir.ref<i32>) }) : () -> () ``` Later, we would inline the delayed privatizer function-like op in the OpenMP region to basically get the same code generated directly by the fronend at the moment. So far this PoC implements the following: - Adds the delayed privatization op: `omp.private`. - For simple symbols, emits the op. Still TODO: - Extend the `omp.target` op to somehow model the oulined privatization logic. - Inline the outlined privatizer before emitting LLVM IR. - Support more complex symbols like allocatables.
- Loading branch information
Showing
8 changed files
with
206 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.