[PATCH] D112445: [fir] Add fir.array_access op

Eric Schweitz via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 26 06:17:26 PDT 2021


schweitz added a comment.

FIR array ops are meant to deal with Fortran's copy-in/copy-out semantics. They introduce a separation of concerns between lowering the parse trees and doing dependence analysis in the front end or resorting to brute-force introduction of ubiquitous array copies.

These operations do not break SSA properties. An array value is preserved and immutable. If an array is modified, then there are array operations that are used to modify the array and the SSA value is required to be threaded like any other newly created value.

Not all types in the IR are first-class with operators in the value domain. Lowering treats these types intuitively as objects in memory with properties that are only known at run-time. To advance the Fortran compiler in a timely manner, a mechanism to access these dynamic elements using memory operations is required. These ops give copy-in/copy-out semantics on arrays under both by-value and by-reference models.

It is fully understood that other solutions exist. Some were considered at length. This one meets the project schedule.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D112445/new/

https://reviews.llvm.org/D112445



More information about the llvm-commits mailing list