[PATCH] D91373: [OpenMP5.0] Support more kinds of lvalues in map clauses

Jacob Weightman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Nov 25 14:50:19 PST 2020


jacobdweightman updated this revision to Diff 307715.
jacobdweightman added a comment.

Thanks for the initial feedback, @ABataev!

I've added one code gen test each for function calls, cast expressions, and ternaries. I haven't added any AST printing tests because I didn't think I changed anything about the AST, but please let me know what needs to be tested and I'll add it. Let me know if I need to be more thorough with the codegen tests as well!

I created this diff according to your instructions and now see that it includes the modified files in their entirety.

Prior to the first revision, I did run some test programs to verify that the changes work (these still work, since I haven't changed anything outside of tests for this revision). I had a test that looked like this for each of the three kinds of lvalue expressions this diff attempts to support:

  #include <assert.h>
  
  int main(void) {
      // test with map
      #pragma omp target data map(tofrom: <lvalue expression>)
      {
          <type of lvalue expression> xp = <lvalue expression>
  
          #pragma omp target
          <some mutation to lvalue expression>
      }
  
      assert(<mutation is reflected on host>);
  
  
      // test with update to/from
      int y;
      #pragma omp target data map(alloc: y) // we need a clause here, so do something useless
      {
          auto xp = <lvalue expression>;
  
          #pragma omp target update to(<lvalue expression>)
  
          #pragma omp target
          <some mutation to lvalue expression>
  
          #pragma omp target update from(<lvalue expression>)
          assert(<mutation is reflected on host>);
      }
  }


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D91373/new/

https://reviews.llvm.org/D91373

Files:
  clang/lib/CodeGen/CGOpenMPRuntime.cpp
  clang/lib/Sema/SemaOpenMP.cpp
  clang/test/OpenMP/target_map_messages.cpp
  clang/test/OpenMP/target_parallel_for_map_messages.cpp
  clang/test/OpenMP/target_parallel_for_simd_map_messages.cpp
  clang/test/OpenMP/target_parallel_map_messages.cpp
  clang/test/OpenMP/target_simd_map_messages.cpp
  clang/test/OpenMP/target_teams_distribute_map_messages.cpp
  clang/test/OpenMP/target_teams_distribute_parallel_for_map_messages.cpp
  clang/test/OpenMP/target_teams_distribute_parallel_for_simd_map_messages.cpp
  clang/test/OpenMP/target_teams_distribute_simd_map_messages.cpp
  clang/test/OpenMP/target_teams_map_messages.cpp
  clang/test/OpenMP/target_update_codegen.cpp
  clang/test/OpenMP/target_update_from_messages.cpp
  clang/test/OpenMP/target_update_to_messages.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D91373.307715.patch
Type: text/x-patch
Size: 113046 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20201125/037d446d/attachment-0001.bin>


More information about the cfe-commits mailing list