Skip to content

Commit a630309

Browse files
authored
[OpenACC] unify reduction and private-like init region recipes (#140652)
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 need to return the yield the same things from their init regions. To mitigate this discrepancy 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 4b54d1a commit a630309

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)