[flang-commits] [flang] [mlir] [mlir][OpenMP] Annotate `private` vars with `map_idx` when needed (PR #116770)

Kareem Ergawy via flang-commits flang-commits at lists.llvm.org
Thu Nov 21 20:47:58 PST 2024


ergawy wrote:

> So, basically, instead of using a 0-based index, you use the object's address in memory as the index. Would that work?

For the `private` values that need a map, we can definitely store a refernce to the SSA value of the corresponding `map` operand to the operation. However, the problem happens when you have a mix of `private` values where some need a map and some don't. For the `private` values that don't need a map, we need to store a placeholder value since we need to 2 ranges of values (the first range being the `private` operands and the second range being the corresponding **optional** `map` operands to these `private` operands). If we choose to store a reference to the `map` value, we will have to store a "null" SSA value for the `private` values that don't need a map which invalidates the IR. Therefore, the attribute solves the problem by using index values and a special non-sensical value like `-1` to represent the absence of a corresponding `map` opernad.

https://github.com/llvm/llvm-project/pull/116770


More information about the flang-commits mailing list