[Mlir-commits] [flang] [mlir] [mlir][flang][OpenMP] Select iterators per locator and allow multi-block regions (PR #227454)
llvmlistbot at llvm.org
llvmlistbot at llvm.org
Sat Oct 10 00:29:06 PDT 2026
================
@@ -6038,6 +6048,15 @@ void OmpStructureChecker::CheckArraySection(
for (const auto &subscript : arrayElement.Subscripts()) {
if (const auto *triplet{
std::get_if<parser::SubscriptTriplet>(&subscript.u)}) {
+ // OpenMP 5.2 3.2.5 allows a stride only in clauses that permit one.
+ // TODO: Also reject strides in DEPEND and REDUCTION, not just AFFINITY.
+ bool affinityStride{clause == llvm::omp::Clause::OMPC_affinity &&
----------------
MattPD wrote:
The explicit stride in `affinity(a(1:8:1)%field(1))` is separate from the lowering failures tracked in [the issue about sections before the last part reference](https://github.com/llvm/llvm-project/issues/230587). [OpenMP 5.2, section 3.2.5](https://www.openmp.org/wp-content/uploads/OpenMP-API-Specification-5-2.pdf#page=86) prohibits that stride, but the locator still passes semantic checking at this revision.
Could the new `AFFINITY` stride check cover earlier part references before merge and still accept sections inside scalar subscript expressions, as in `b(sum(v(::2)))`?
https://github.com/llvm/llvm-project/pull/227454
More information about the Mlir-commits
mailing list