[flang-commits] [flang] [llvm] [flang] Support static-unit array slices in FIR LoopVersioning (PR #222723)

Sergey Shcherbinin via flang-commits flang-commits at lists.llvm.org
Thu Sep 24 03:08:24 PDT 2026


SergeyShch01 wrote:

@jeanPerier,
I reworked the patch following your suggestion to reuse the existing LoopVersioning analysis and emitter instead of introducing separate slice-specific machinery.

Static-unit slices now only add the slice lower-bound correction to the existing flat index and reuse the current stride guard and typed fast path. I also simplified the constant-one check, removed the layout/preflight/ownership infrastructure, and kept slice-free emission and indexing unchanged. Shared descriptor discovery now follows loaded pointer-dummy boxes, covering the pointer case raised during review.

The tests were updated for the simplified implementation, including an explicit check that disabling slice support does not change slice-free or unsupported cases.

@Ritanya-B-Bharadwaj,
The patch now supports this pointer-array case: it follows the loaded pointer descriptors and emits the correct `byte stride == 16` guards for `complex(real64)`. I also added the example as a source-level LIT regression test.

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


More information about the flang-commits mailing list