Skip to content

Commit eed6fd1

Browse files
author
Scott Manley
committed
[OpenACC] unify reduction and private-like init region recipes
Between firstprivate, private and reduction init regions, the difference is largely whether or not the temp that is created is initialized or not. Some recent fixes were made to privatization (#135698, #137869) but did not get propagated to reductions, even though they essentially do the same thing. To mitigate this descrepency in the future, refactor the init region recipes so they can be shared between the three recipe ops. Also add "none" to the OpenACC_ReductionOperator enum for better error checking.
1 parent 7a24238 commit eed6fd1

File tree

4 files changed

+233
-272
lines changed

4 files changed

+233
-272
lines changed

flang/include/flang/Lower/OpenACC.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ void genOpenACCRoutineConstruct(
8585

8686
/// Get a acc.private.recipe op for the given type or create it if it does not
8787
/// exist yet.
88-
mlir::acc::PrivateRecipeOp createOrGetPrivateRecipe(mlir::OpBuilder &,
88+
mlir::acc::PrivateRecipeOp createOrGetPrivateRecipe(fir::FirOpBuilder &,
8989
llvm::StringRef,
9090
mlir::Location, mlir::Type);
9191

@@ -99,7 +99,7 @@ createOrGetReductionRecipe(fir::FirOpBuilder &, llvm::StringRef, mlir::Location,
9999
/// Get a acc.firstprivate.recipe op for the given type or create it if it does
100100
/// not exist yet.
101101
mlir::acc::FirstprivateRecipeOp
102-
createOrGetFirstprivateRecipe(mlir::OpBuilder &, llvm::StringRef,
102+
createOrGetFirstprivateRecipe(fir::FirOpBuilder &, llvm::StringRef,
103103
mlir::Location, mlir::Type,
104104
llvm::SmallVector<mlir::Value> &);
105105

0 commit comments

Comments
 (0)