llvm-project
7634a965 - [flang][acc] Improve lowering of Fortran optional in data clause (#102224)

Commit
1 year ago
[flang][acc] Improve lowering of Fortran optional in data clause (#102224) Fortran optional arguments are effectively null references. To deal with this possibility, flang lowering of OpenACC data clauses creates three if-else regions when preparing the data pointer for the data clause: 1) Load box value from box reference 2) Load box addr from box value 3) Load box dims from box value However, this pattern makes it more complicated to find the original box reference. Effectively, the first if-else region to get the box value is not needed - since the value can be loaded before the corresponding `fir.box_addr` and `fir.box_dims` operations. Thus, reduce the number of if-else regions by deferring the box load to the use sites. For non-optional cases, the old functionality is left alone - which preloads the box value.
Parents
Loading