Issue 61452
Summary clang miss-compiles openmp target update with stride.
Labels
Assignees
Reporter fel-cab
    In the IRs, it can be seen that the `offload_maptypes` don't have the correct values

The following kernels were compiled with:
`clang -Iompvv/ -g -fopenmp --offload-arch=native -fopenmp-version=50 -emit-llvm -S `
`clang version 17.0.0 (https://github.com/llvm/llvm-project.git ca4c5331823755d5f7ae28a8bcaaa0fed21cf762)`

Three versions
1. `#pragma omp target update to(result[0:N:2])`
```
@.offload_maptypes.2 = private unnamed_addr constant [1 x i64] [i64 1]
@3 = private unnamed_addr constant [86 x i8] c";result[0:64:2];tests/5.0/target_update/test_target_update_to_discontiguous.c;22;11;;\00", align 1
```

2. `#pragma omp target update from(result[0:N:2])`
```
@.offload_maptypes.5 = private unnamed_addr constant [1 x i64] [i64 2]
@5 = private unnamed_addr constant [88 x i8] c";result[0:64:2];tests/5.0/target_update/test_target_update_from_discontiguous.c;22;11;;\00", align 1
```

3. `#pragma omp target update from(s.data[0:s.len:2])`
```
@.offload_maptypes.7 = private unnamed_addr constant [2 x i64] [i64 0, i64 281474976710674]
@10 = private unnamed_addr constant [97 x i8] c";s.data[0:s.len:2];tests/5.0/target_update/test_target_update_mapper_from_discontiguous.c;31;5;;\00", align 1
```

In this one, 
`281474976710674  = 0x1000000000012`
`And it Should be    0x100000000012`

The complete programs can be found in:

https://github.com/SOLLVE/sollve_vv/blob/master/tests/5.0/target_update/test_target_update_from_discontiguous.c
https://github.com/SOLLVE/sollve_vv/blob/master/tests/5.0/target_update/test_target_update_mapper_from_discontiguous.c
https://github.com/SOLLVE/sollve_vv/blob/master/tests/5.0/target_update/test_target_update_to_discontiguous.c

_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to