Slava Zakharin 556ff19db9
[flang] Create TBAA subtree for COMMON block variables. (#156558)
In order to help LLVM disambiguate accesses to the COMMON
block variables, this patch creates a TBAA sub-tree for each
COMMON block, and the places all variables belonging to this
COMMON block into this sub-tree. The structure looks like this:
```
  common /blk/ a, b, c

  "global data"
  |
  |- "blk_"
     |
     |- "blk_/bytes_0_to_3"
     |- "blk_/bytes_4_to_7"
     |- "blk_/bytes_8_to_11"
```

The TBAA tag for "a" is created in "blk_/bytes_0_to_3" root, etc.
The byte spans are created based on the `storage` information
provided by `fir.declare` (#155742).

See also:
https://discourse.llvm.org/t/rfc-flang-representation-for-objects-inside-physical-storage/88026
2025-09-04 15:49:38 -07:00
..