[clang] [llvm] Codegen changes for strict modifier with grainsize/num_tasks of taskloop construct (PR #117196)
CHANDRA GHALE via llvm-commits
llvm-commits at lists.llvm.org
Sat Nov 23 03:43:09 PST 2024
================
@@ -7831,10 +7831,14 @@ void CodeGenFunction::EmitOMPTaskLoopBasedDirective(const OMPLoopDirective &S) {
// grainsize clause
Data.Schedule.setInt(/*IntVal=*/false);
Data.Schedule.setPointer(EmitScalarExpr(Clause->getGrainsize()));
+ Data.HasModifier =
+ (Clause->getModifier() == OMPC_GRAINSIZE_strict) ? true : false;
} else if (const auto *Clause = S.getSingleClause<OMPNumTasksClause>()) {
// num_tasks clause
Data.Schedule.setInt(/*IntVal=*/true);
Data.Schedule.setPointer(EmitScalarExpr(Clause->getNumTasks()));
+ Data.HasModifier =
+ (Clause->getModifier() == OMPC_NUMTASKS_strict) ? true : false;
----------------
chandraghale wrote:
@shiltian
We need to check which Clause is present (either GrainsizeClause or NumTasksClause) and handle the case where no clause is matched. Combining the conditions would require an extra variable to track the clause type. I suggest sticking with the current logic, as it is simple and clear. What do you think?
https://github.com/llvm/llvm-project/pull/117196
More information about the llvm-commits
mailing list