Commit 1af0424
authored
[flang][OpenACC] simplify copy and combiner recipe generation (#164988)
OpenACC copy and combiner recipe generation had non-trivial
ad-hoc handling of the FIR types, and ended-up generating hlfir.assign
that become runtime calls for arrays because of the lack of aliasing
guarantees given to FIR for the region arguments.
This code was started before HFLIR, and with HLFIR tools, most of the
type specific handling can just be removed to use hlfir generic helper
and assign (-230 lines in OpenACC.cpp).
To avoid ending up with runtime calls in recipes:
- use hlfir.assign temporary_lhs in copies to indicate that the copy
cannot alias with the rhs.
- add a new genNoAliasAssignment hlfir helper that takes its logic from
the HLFIRInlineIntrinsic pass and allows applying a scalar combiner
before generating the scalar assignments. This allows generating loops
directly for the reduction and avoid having to find a clever way to
signal HLFIR that the arguments do not alias (an other option would have
been to introduce a dummy_scope and declares, but that would not be
enough for POINTERs, and I am not sure we should start using this as a
noalias operation).1 parent fa050ea commit 1af0424
File tree
6 files changed
+1474
-1161
lines changed- flang
- include/flang/Optimizer/Builder
- lib
- Lower
- Optimizer
- Builder
- HLFIR/Transforms
- test/Lower/OpenACC
6 files changed
+1474
-1161
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
450 | 450 | | |
451 | 451 | | |
452 | 452 | | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
453 | 488 | | |
454 | 489 | | |
455 | 490 | | |
| |||
0 commit comments