This patch adds the fir.array_amend operation. this op
is used later in upstreaming patches for the F95 compliance.
The array_amend operation marks an array value as having been changed via
a reference obtain by an array_access. It acts as a logical transaction
log that is used to merge the final result back with an array_merge_store
operation.
mlir // fetch the value of one of the array value's elements %1 = fir.array_access %v, %i, %j : (!fir.array<?x?xT>, index, index) -> !fir.ref<T> // modify the element by storing data using %1 as a reference %2 = ... %1 ... // mark the array value %new_v = fir.array_amend %v, %2 : (!fir.array<?x?xT>, !fir.ref<T>) -> !fir.array<?x?xT>
This patch is part of the upstreaming effort from fir-dev branch.
Co-authored-by: Eric Schweitz <eschweitz@nvidia.com>
Nit: obtained