[clang] [llvm] Codegen changes for strict modifier with grainsize/num_tasks of taskloop construct (PR #117196)
Shilei Tian via llvm-commits
llvm-commits at lists.llvm.org
Fri Nov 22 11:33:58 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;
----------------
shiltian wrote:
You can combine the two as something like:
```
Data.HasModifier = Clause->getModifier() == OMPC_GRAINSIZE_strict || Clause->getModifier() == OMPC_NUMTASKS_strict;
https://github.com/llvm/llvm-project/pull/117196
More information about the llvm-commits
mailing list