[all-commits] [llvm/llvm-project] cbf64b: [OpenMP] Fix map clause for unused var: don't igno...
Joel E. Denny via All-commits
all-commits at lists.llvm.org
Fri Jul 17 18:37:49 PDT 2020
Branch: refs/heads/master
Home: https://github.com/llvm/llvm-project
Commit: cbf64b58345dd9c1f0032c4fce558ed2f1fd0fe4
https://github.com/llvm/llvm-project/commit/cbf64b58345dd9c1f0032c4fce558ed2f1fd0fe4
Author: Joel E. Denny <jdenny.ornl at gmail.com>
Date: 2020-07-17 (Fri, 17 Jul 2020)
Changed paths:
M clang/lib/CodeGen/CGOpenMPRuntime.cpp
M clang/test/OpenMP/target_map_codegen.cpp
M clang/test/OpenMP/target_teams_map_codegen.cpp
Log Message:
-----------
[OpenMP] Fix map clause for unused var: don't ignore it
For example, without this patch:
```
$ cat test.c
int main() {
int x[3];
#pragma omp target map(tofrom:x[0:3])
#ifdef USE
x[0] = 1
#endif
;
return 0;
}
$ clang -fopenmp -fopenmp-targets=nvptx64-nvidia-cuda -S -emit-llvm test.c
$ grep '^@.offload_maptypes' test.ll
$ echo $?
1
$ clang -fopenmp -fopenmp-targets=nvptx64-nvidia-cuda -S -emit-llvm test.c \
-DUSE
$ grep '^@.offload_maptypes' test.ll
@.offload_maptypes = private unnamed_addr constant [1 x i64] [i64 35]
```
With this patch, both greps produce the same result.
Reviewed By: ABataev
Differential Revision: https://reviews.llvm.org/D83922
More information about the All-commits
mailing list