Commit 667b0fd
Automerge: [flang][OpenMP] Map device pointers on host device as well (#145562)
Given a TARGET DATA construct with USE_DEVICE_PTR(x) and IF(FALSE), the
compiler will crash if `x` was used in the body. The cause of the crash
is that the MLIR->LLVM codegen tries to look up the translated value of
x, but one had not been mapped.
Given an IF clause, the translation will generate an if-then-else
construct, with the "else" block corresponding to the false condition,
i.e. the host device playing the role of the target device. In that
block, still process the USE_DEVICE_ADDR/USE_DEVICE_PTR clauses, which
will cause the translation mappings to be created.
Fixes llvm/llvm-project#145558File tree
2 files changed
+39
-3
lines changed- flang/test/Lower/OpenMP
- mlir/lib/Target/LLVMIR/Dialect/OpenMP
2 files changed
+39
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
Lines changed: 14 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4518 | 4518 | | |
4519 | 4519 | | |
4520 | 4520 | | |
| 4521 | + | |
| 4522 | + | |
4521 | 4523 | | |
4522 | 4524 | | |
4523 | 4525 | | |
| |||
4549 | 4551 | | |
4550 | 4552 | | |
4551 | 4553 | | |
4552 | | - | |
4553 | | - | |
4554 | | - | |
| 4554 | + | |
| 4555 | + | |
| 4556 | + | |
| 4557 | + | |
| 4558 | + | |
| 4559 | + | |
| 4560 | + | |
| 4561 | + | |
| 4562 | + | |
| 4563 | + | |
| 4564 | + | |
| 4565 | + | |
4555 | 4566 | | |
4556 | 4567 | | |
4557 | 4568 | | |
| |||
0 commit comments