-
Notifications
You must be signed in to change notification settings - Fork 14.9k
[Flang][mlir] - Translation of delayed privatization for deferred target-tasks #155348
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
938091d
f72152a
c859bbc
697cc4f
bc107cd
f7dacb3
f4a13ea
c8fad74
e74fa7d
343f7ec
41bb5b2
3264bfe
b9fb8ce
7032cae
269c575
3109e4f
d5b9c27
8bd4359
a393ff1
28ec66a
d95799d
0829719
01d1f69
d595572
bf949fa
72a769f
061669f
e036923
5b78bab
b34b0e0
4c5d8d8
6288da9
0a4ef58
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
set(LLVM_TARGET_DEFINITIONS Passes.td) | ||
mlir_tablegen(Passes.h.inc -gen-pass-decls -name OpenMP) | ||
add_public_tablegen_target(MLIROpenMPPassIncGen) | ||
|
||
add_mlir_doc(Passes OpenMPPasses ./ -gen-pass-doc) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
//===- OpenMPOffloadPrivatizationPrepare.h ----------------------*- C++ -*-===// | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this file should be deleted and then include |
||
// | ||
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | ||
// See https://llvm.org/LICENSE.txt for license information. | ||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
// | ||
//===----------------------------------------------------------------------===// | ||
|
||
#ifndef MLIR_DIALECT_OPENMP_TRANSFORMS_PREPAREFOROMPOFFLOADPRIVATIZATIONPASS_H | ||
#define MLIR_DIALECT_OPENMP_TRANSFORMS_PREPAREFOROMPOFFLOADPRIVATIZATIONPASS_H | ||
|
||
#include <memory> | ||
|
||
namespace mlir { | ||
class Pass; | ||
namespace omp { | ||
#define GEN_PASS_DECL_PREPAREFOROMPOFFLOADPRIVATIZATIONPASS | ||
#include "mlir/Dialect/OpenMP/Transforms/Passes.h.inc" | ||
} // namespace omp | ||
} // namespace mlir | ||
|
||
#endif // MLIR_DIALECT_OPENMP_TRANSFORMS_PREPAREFOROMPOFFLOADPRIVATIZATIONPASS_H |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
//===- Passes.h - LLVM Pass Construction and Registration -------*- C++ -*-===// | ||
bhandarkar-pranav marked this conversation as resolved.
Show resolved
Hide resolved
|
||
// | ||
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | ||
// See https://llvm.org/LICENSE.txt for license information. | ||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
// | ||
//===----------------------------------------------------------------------===// | ||
|
||
#ifndef MLIR_DIALECT_OPENMP_TRANSFORMS_PASSES_H | ||
#define MLIR_DIALECT_OPENMP_TRANSFORMS_PASSES_H | ||
|
||
#include "mlir/Pass/Pass.h" | ||
|
||
namespace mlir { | ||
|
||
namespace omp { | ||
|
||
/// Generate the code for registering conversion passes. | ||
#define GEN_PASS_DECL | ||
#define GEN_PASS_REGISTRATION | ||
#include "mlir/Dialect/OpenMP/Transforms/Passes.h.inc" | ||
|
||
} // namespace omp | ||
} // namespace mlir | ||
|
||
#endif // MLIR_DIALECT_LLVMIR_TRANSFORMS_PASSES_H |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
//===-- Passes.td - LLVM pass definition file --------------*- tablegen -*-===// | ||
bhandarkar-pranav marked this conversation as resolved.
Show resolved
Hide resolved
|
||
// | ||
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | ||
// See https://llvm.org/LICENSE.txt for license information. | ||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
// | ||
//===----------------------------------------------------------------------===// | ||
|
||
#ifndef MLIR_DIALECT_OPENMP_TRANSFORMS_PASSES | ||
#define MLIR_DIALECT_OPENMP_TRANSFORMS_PASSES | ||
|
||
include "mlir/Pass/PassBase.td" | ||
|
||
def PrepareForOMPOffloadPrivatizationPass : Pass<"omp-offload-privatization-prepare", "::mlir::LLVM::LLVMFuncOp"> { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should this be a module pass instead since the pass modifies the parent module? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Will change. |
||
let summary = "Prepare OpenMP maps for privatization for deferred target tasks"; | ||
let description = [{ | ||
When generating LLVMIR for privatized variables in an OpenMP offloading directive (eg. omp::TargetOp) | ||
that creates a deferred target task (when the nowait clause is used), we need to copy the privatized | ||
variable out of the stack of the generating task and into the heap so that the deferred target task | ||
can still access it. However, if such a privatized variable is also mapped, typically the case for | ||
allocatables, then the corresponding `omp::MapInfoOp` needs to be fixed up to map the new heap-allocated | ||
variable and not the original variable. | ||
}]; | ||
let dependentDialects = ["LLVM::LLVMDialect"]; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think we need to add |
||
} | ||
#endif // MLIR_DIALECT_OPENMP_TRANSFORMS_PASSES |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
add_subdirectory(Transforms) | ||
|
||
add_mlir_dialect_library(MLIROpenMPDialect | ||
IR/OpenMPDialect.cpp | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
add_mlir_dialect_library(MLIROpenMPTransforms | ||
OpenMPOffloadPrivatizationPrepare.cpp | ||
|
||
DEPENDS | ||
MLIROpenMPPassIncGen | ||
|
||
LINK_LIBS PUBLIC | ||
MLIRIR | ||
MLIRFuncDialect | ||
MLIRLLVMDialect | ||
MLIROpenMPDialect | ||
MLIRPass | ||
MLIRTransforms | ||
) |
Uh oh!
There was an error while loading. Please reload this page.