This is an archive of the discontinued LLVM Phabricator instance.

[OpenMP] Upgrade default version of OpenMP to 5.0
ClosedPublic

Authored by saiislam on Jun 3 2020, 7:54 AM.

Details

Summary

When -fopenmp option is specified then version 5.0 will be set as
default.

Diff Detail

Event Timeline

saiislam created this revision.Jun 3 2020, 7:54 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 3 2020, 7:54 AM

Currently, following 75 lit-tests are failing.

  1. Clang :: OpenMP/declare_reduction_codegen.c
  2. Clang :: OpenMP/declare_reduction_codegen.cpp
  3. Clang :: OpenMP/declare_target_messages.cpp
  4. Clang :: OpenMP/declare_variant_implementation_vendor_codegen.cpp
  5. Clang :: OpenMP/distribute_parallel_for_simd_loop_messages.cpp
  6. Clang :: OpenMP/distribute_simd_loop_messages.cpp
  7. Clang :: OpenMP/driver.c
  8. Clang :: OpenMP/for_codegen.cpp
  9. Clang :: OpenMP/for_collapse_messages.cpp
  10. Clang :: OpenMP/for_loop_messages.cpp
  11. Clang :: OpenMP/for_simd_loop_messages.cpp
  12. Clang :: OpenMP/master_taskloop_loop_messages.cpp
  13. Clang :: OpenMP/master_taskloop_simd_loop_messages.cpp
  14. Clang :: OpenMP/nesting_of_regions.cpp
  15. Clang :: OpenMP/ordered_codegen.cpp
  16. Clang :: OpenMP/parallel_for_codegen.cpp
  17. Clang :: OpenMP/parallel_for_loop_messages.cpp
  18. Clang :: OpenMP/parallel_for_simd_codegen.cpp
  19. Clang :: OpenMP/parallel_for_simd_loop_messages.cpp
  20. Clang :: OpenMP/parallel_master_taskloop_loop_messages.cpp
  21. Clang :: OpenMP/parallel_master_taskloop_simd_loop_messages.cpp
  22. Clang :: OpenMP/simd_loop_messages.cpp
  23. Clang :: OpenMP/single_codegen.cpp
  24. Clang :: OpenMP/target_depend_messages.cpp
  25. Clang :: OpenMP/target_enter_data_depend_messages.cpp
  26. Clang :: OpenMP/target_exit_data_depend_messages.cpp
  27. Clang :: OpenMP/target_map_messages.cpp
  28. Clang :: OpenMP/target_messages.cpp
  29. Clang :: OpenMP/target_parallel_depend_messages.cpp
  30. Clang :: OpenMP/target_parallel_for_depend_messages.cpp
  31. Clang :: OpenMP/target_parallel_for_loop_messages.cpp
  32. Clang :: OpenMP/target_parallel_for_map_messages.cpp
  33. Clang :: OpenMP/target_parallel_for_simd_depend_messages.cpp
  34. Clang :: OpenMP/target_parallel_for_simd_is_device_ptr_messages.cpp
  35. Clang :: OpenMP/target_parallel_for_simd_map_messages.cpp
  36. Clang :: OpenMP/target_parallel_is_device_ptr_messages.cpp
  37. Clang :: OpenMP/target_parallel_map_messages.cpp
  38. Clang :: OpenMP/target_simd_depend_messages.cpp
  39. Clang :: OpenMP/target_simd_map_messages.cpp
  40. Clang :: OpenMP/target_teams_depend_messages.cpp
  41. Clang :: OpenMP/target_teams_distribute_depend_messages.cpp
  42. Clang :: OpenMP/target_teams_distribute_loop_messages.cpp
  43. Clang :: OpenMP/target_teams_distribute_map_messages.cpp
  44. Clang :: OpenMP/target_teams_distribute_parallel_for_depend_messages.cpp
  45. Clang :: OpenMP/target_teams_distribute_parallel_for_is_device_ptr_messages.cpp
  46. Clang :: OpenMP/target_teams_distribute_parallel_for_lastprivate_messages.cpp
  47. Clang :: OpenMP/target_teams_distribute_parallel_for_loop_messages.cpp
  48. Clang :: OpenMP/target_teams_distribute_parallel_for_map_messages.cpp
  49. Clang :: OpenMP/target_teams_distribute_parallel_for_simd_depend_messages.cpp
  50. Clang :: OpenMP/target_teams_distribute_parallel_for_simd_firstprivate_messages.cpp
  51. Clang :: OpenMP/target_teams_distribute_parallel_for_simd_is_device_ptr_messages.cpp
  52. Clang :: OpenMP/target_teams_distribute_parallel_for_simd_lastprivate_messages.cpp
  53. Clang :: OpenMP/target_teams_distribute_parallel_for_simd_map_messages.cpp
  54. Clang :: OpenMP/target_teams_distribute_simd_depend_messages.cpp
  55. Clang :: OpenMP/target_teams_distribute_simd_firstprivate_messages.cpp
  56. Clang :: OpenMP/target_teams_distribute_simd_is_device_ptr_messages.cpp
  57. Clang :: OpenMP/target_teams_distribute_simd_lastprivate_messages.cpp
  58. Clang :: OpenMP/target_teams_distribute_simd_loop_messages.cpp
  59. Clang :: OpenMP/target_teams_distribute_simd_map_messages.cpp
  60. Clang :: OpenMP/target_teams_distribute_simd_private_messages.cpp
  61. Clang :: OpenMP/target_teams_is_device_ptr_messages.cpp
  62. Clang :: OpenMP/target_teams_map_messages.cpp
  63. Clang :: OpenMP/target_update_depend_messages.cpp
  64. Clang :: OpenMP/target_update_from_messages.cpp
  65. Clang :: OpenMP/target_update_to_messages.cpp
  66. Clang :: OpenMP/taskloop_loop_messages.cpp
  67. Clang :: OpenMP/taskloop_simd_loop_messages.cpp
  68. Clang :: OpenMP/teams_distribute_loop_messages.cpp
  69. Clang :: OpenMP/teams_distribute_parallel_for_loop_messages.cpp
  70. Clang :: OpenMP/teams_distribute_parallel_for_simd_firstprivate_messages.cpp
  71. Clang :: OpenMP/teams_distribute_parallel_for_simd_loop_messages.cpp
  72. Clang :: OpenMP/teams_distribute_simd_firstprivate_messages.cpp
  73. Clang :: OpenMP/teams_distribute_simd_loop_messages.cpp
  74. Clang :: OpenMP/teams_messages.cpp
  75. Clang :: OpenMP/threadprivate_codegen.cpp
saiislam updated this revision to Diff 269239.Jun 8 2020, 8:13 AM

Fixed 25 out of 75 failing test cases by marking all old default cases as omp4 tests, and new tests as omp5.
All these tests are now specific to the version of openmp, so that we don't run into similar problem during next version upgrade.

Need to update few other places.
CompilerInvocation.cpp:3082 and CompilerInvocation.cpp:3085, which sets the default version to 45 in the presense of the target option or simd option. Most probably, need to remove this check. It was used to use 45 as the default version for target(simd)-based switches when the default version was 40.

saiislam updated this revision to Diff 269925.Jun 10 2020, 11:39 AM

[Work in progress] Requesting early comments. 28 tests are still failing.

[Work in progress] Requesting early comments. 28 tests are still failing.

Looks good in general

saiislam updated this revision to Diff 271351.Jun 17 2020, 6:20 AM

Following tests are currently failing:

Clang :: OpenMP/declare_target_codegen.cpp
Clang :: OpenMP/target_codegen.cpp
Clang :: OpenMP/target_map_codegen.cpp
Clang :: OpenMP/target_simd_depend_codegen.cpp
Clang :: OpenMP/target_teams_distribute_parallel_for_schedule_codegen.cpp
Clang :: OpenMP/target_teams_distribute_parallel_for_simd_schedule_codegen.cpp
Clang :: OpenMP/teams_distribute_parallel_for_schedule_codegen.cpp
Clang :: OpenMP/teams_distribute_parallel_for_simd_schedule_codegen.cpp
Clang :: OpenMP/threadprivate_codegen.cpp

Looks good.

saiislam updated this revision to Diff 273037.Jun 24 2020, 8:31 AM
  1. All tests are passing in local testing.
  2. Rebased
  3. Plan is to create a follow up patch, if required, to ensure that testing happens without the version string as well.

It will ensure that deviating behaviour(tests) are uncovered during next version bump.

  1. Thank you @pdhaliwal for fixing many of these tests.
This revision is now accepted and ready to land.Jun 24 2020, 11:38 AM
This revision was automatically updated to reflect the committed changes.
clementval added a subscriber: clementval.EditedJun 30 2020, 11:44 AM

LG

Since this revision landed two tests are failing.

libomp.env::kmp_set_dispatch_buf.c and libomp.worksharing/for::kmp_set_dispatch_buf.c. It was also reported on the mailing list (http://lists.llvm.org/pipermail/openmp-dev/2020-June/003507.html). Any idea how we can fix this quickly? @jdoerfert
OR maybe this is known and will be taken care later?

jdenny added a subscriber: jdenny.Jun 30 2020, 12:18 PM

LG

Since this revision landed two tests are failing.

libomp.env::kmp_set_dispatch_buf.c and libomp.worksharing/for::kmp_set_dispatch_buf.c. It was also reported on the mailing list (http://lists.llvm.org/pipermail/openmp-dev/2020-June/003507.html). Any idea how we can fix this quickly? @jdoerfert
OR maybe this is known and will be taken care later?

Thank you @clementval. I have posted a review to temporarily disable these tests for 5.0 (they are passing with 4.5): https://reviews.llvm.org/D82963