Page MenuHomePhabricator

[flang][OpenMP] Enhance parser support for taskwait construct to OpenMP 5.0
ClosedPublic

Authored by kiranktp on Jun 20 2020, 1:34 AM.

Details

Summary

This patch enhances parser support for taskwait construct to OpenMP 5.0.

2.17.5 taskwait Construct
!$omp taskwait [clause[ [,] clause] ... ]

		where clause is one of the following:
		depend([depend-modifier,]dependence-type : locator-list)

The patch includes code changes and testcase modifications.

Diff Detail

Unit TestsFailed

TimeTest
500 mslinux > MemorySanitizer-X86_64.MemorySanitizer-X86_64::Unknown Unit Message ("")
Script: -- : 'RUN: at line 1'; /mnt/disks/ssd0/agent/llvm-project/build/./bin/clang --driver-mode=g++ -fsanitize=memory -mno-omit-leaf-frame-pointer -fno-omit-frame-pointer -fno-optimize-sibling-calls -m64 -gline-tables-only -O0 -g /mnt/disks/ssd0/agent/llvm-project/compiler-rt/test/msan/strxfrm.cpp -o /mnt/disks/ssd0/agent/llvm-project/build/projects/compiler-rt/test/msan/X86_64/Output/strxfrm.cpp.tmp && /mnt/disks/ssd0/agent/llvm-project/build/projects/compiler-rt/test/msan/X86_64/Output/strxfrm.cpp.tmp
240 mslinux > MemorySanitizer-lld-X86_64.MemorySanitizer-lld-X86_64::Unknown Unit Message ("")
Script: -- : 'RUN: at line 1'; /mnt/disks/ssd0/agent/llvm-project/build/./bin/clang --driver-mode=g++ -fsanitize=memory -mno-omit-leaf-frame-pointer -fno-omit-frame-pointer -fno-optimize-sibling-calls -m64 -fuse-ld=lld -gline-tables-only -O0 -g /mnt/disks/ssd0/agent/llvm-project/compiler-rt/test/msan/strxfrm.cpp -o /mnt/disks/ssd0/agent/llvm-project/build/projects/compiler-rt/test/msan/lld-X86_64/Output/strxfrm.cpp.tmp && /mnt/disks/ssd0/agent/llvm-project/build/projects/compiler-rt/test/msan/lld-X86_64/Output/strxfrm.cpp.tmp
560 mslinux > SanitizerCommon-asan-x86_64-Linux.Linux::Unknown Unit Message ("")
Script: -- : 'RUN: at line 1'; /mnt/disks/ssd0/agent/llvm-project/build/./bin/clang --driver-mode=g++ -gline-tables-only -fsanitize=address -m64 -ldl -std=c++11 -O0 -g /mnt/disks/ssd0/agent/llvm-project/compiler-rt/test/sanitizer_common/TestCases/Linux/protoent.cpp -o /mnt/disks/ssd0/agent/llvm-project/build/projects/compiler-rt/test/sanitizer_common/asan-x86_64-Linux/Linux/Output/protoent.cpp.tmp && /mnt/disks/ssd0/agent/llvm-project/build/projects/compiler-rt/test/sanitizer_common/asan-x86_64-Linux/Linux/Output/protoent.cpp.tmp 2>&1 | FileCheck /mnt/disks/ssd0/agent/llvm-project/compiler-rt/test/sanitizer_common/TestCases/Linux/protoent.cpp
290 mslinux > SanitizerCommon-lsan-x86_64-Linux.Linux::Unknown Unit Message ("")
Script: -- : 'RUN: at line 1'; /mnt/disks/ssd0/agent/llvm-project/build/./bin/clang --driver-mode=g++ -gline-tables-only -fsanitize=leak -m64 -ldl -std=c++11 -O0 -g /mnt/disks/ssd0/agent/llvm-project/compiler-rt/test/sanitizer_common/TestCases/Linux/protoent.cpp -o /mnt/disks/ssd0/agent/llvm-project/build/projects/compiler-rt/test/sanitizer_common/lsan-x86_64-Linux/Linux/Output/protoent.cpp.tmp && /mnt/disks/ssd0/agent/llvm-project/build/projects/compiler-rt/test/sanitizer_common/lsan-x86_64-Linux/Linux/Output/protoent.cpp.tmp 2>&1 | FileCheck /mnt/disks/ssd0/agent/llvm-project/compiler-rt/test/sanitizer_common/TestCases/Linux/protoent.cpp
410 mslinux > SanitizerCommon-msan-x86_64-Linux.Linux::Unknown Unit Message ("")
Script: -- : 'RUN: at line 1'; /mnt/disks/ssd0/agent/llvm-project/build/./bin/clang --driver-mode=g++ -gline-tables-only -fsanitize=memory -m64 -ldl -std=c++11 -O0 -g /mnt/disks/ssd0/agent/llvm-project/compiler-rt/test/sanitizer_common/TestCases/Linux/protoent.cpp -o /mnt/disks/ssd0/agent/llvm-project/build/projects/compiler-rt/test/sanitizer_common/msan-x86_64-Linux/Linux/Output/protoent.cpp.tmp && /mnt/disks/ssd0/agent/llvm-project/build/projects/compiler-rt/test/sanitizer_common/msan-x86_64-Linux/Linux/Output/protoent.cpp.tmp 2>&1 | FileCheck /mnt/disks/ssd0/agent/llvm-project/compiler-rt/test/sanitizer_common/TestCases/Linux/protoent.cpp
View Full Test Results (9 Failed)

Event Timeline

kiranktp created this revision.Jun 20 2020, 1:34 AM
kiranktp updated this revision to Diff 272683.Jun 23 2020, 5:05 AM
kiranktp edited the summary of this revision. (Show Details)

Corrected the section number to 2.17.5 [from OpenMP 5.0] for taskwait construct

Lint: Pre-merge checks

/mnt/disks/ssd0/agent/llvm-project/flang/lib/Semantics/check-omp-structure.cpp:671:18: warning: invalid case style for variable 'allowed' [readability-identifier-naming]

OmpClauseSet allowed{OmpClause::DEPEND};
             ^~~~~~~
             Allowed

I think I can neglect this warning as i have used the correct naming convention for the variable.
Local variables names should start with lower case. The same has been used in multiple places in the same file.

This looks OK but needs a rebase after @clementval's changes.

This looks OK but needs a rebase after @clementval's changes.

Thanks Kiran. I will rebase this patch and submit again.

kiranktp updated this revision to Diff 278098.Jul 15 2020, 12:57 AM

Rebasing after @clementval's patch and adding appropriate changes needed.

LGTM.

Please wait for approval from @clementval.

This revision is now accepted and ready to land.Jul 15 2020, 1:55 AM
clementval accepted this revision.Jul 15 2020, 6:18 AM

Minor comment but LGTM.

llvm/include/llvm/Frontend/OpenMP/OMP.td
317

Is it allowed from 5.0 or before? If it is allowed from 5.0 you can specify it like VersionedClause<OMPC_Depend, 50> so it will be accepted (in clang so far) from 5.0 and later. This feature is not used in Flang for the moment.

Minor comment but LGTM.

Thanks for the review @clementval. This is allowed from OpenMP 5.0 and later.
I will do the modification.

kiranktp updated this revision to Diff 278223.Jul 15 2020, 9:37 AM

taskwait has depend clause from OpenMP 5.0 and later.

clementval accepted this revision.Jul 15 2020, 10:07 AM

Still LGTM

This revision was automatically updated to reflect the committed changes.