This patch adds OpenMP 4.0 task dependencies handling code that is
missing in LLVM libomp's GOMP compatibility layer. The absence of this
code is responsible for weird behaviour of the taskdep benchmarks from
Kastors suite whenever they are compiled using GCC and linked against LLVM libomp
instead of GOMP.
Details
Diff Detail
- Repository
- rL LLVM
Event Timeline
This change breaks codes compiled by gcc 4.8 or earlier, because it is unsafe to unconditionally read the new parameter that earlier compilers don't provide. Note that new libgomp library works fine with old compilers, so there should probably be some flag (bit in existing gomp_flags) responsible for providing newly added parameter.
runtime/src/kmp_gsupport.cpp | ||
---|---|---|
923 ↗ | (On Diff #92124) | priority is probably an OpenMP 4.5 thing? |
Is "dep_list[i].flags.in = 1;" really supposed to be set in both of the if cases (lines 980 and 983)?
If so, can't we lift that out of the if?
Yes and maybe. It must me set to 1 for both due to `KMP_DEBUG_ASSERT(dep->flags.in);` checked for each task dependency processed by __kmp_process_deps() in kmp_taskdeps.cpp. Setting all flags in both branches seemed to me as better expressing my intents, but I can change it if you insist.
LGTM
runtime/src/kmp_gsupport.cpp | ||
---|---|---|
923 ↗ | (On Diff #92124) | Right, the priority is 4.5 addition, and we can add its implementation later if we want to. |
Setting all flags in both branches seemed to me as better expressing my intents, but I can change it if you insist.
I am not going to insist. I just find it odd to have a duplicate line of code, and the fact that it is the same in both if branches made me suspicious that there was bug lurking there. So, personally, I would find code like this clearer.
dep_list[i].len = 0U; dep_list[i].flags.in = 1; dep_list[i].flags.out = i<nout;