[flang-commits] [flang] [flang][OpenMP] Add alias analysis for omp private (PR #113566)
via flang-commits
flang-commits at lists.llvm.org
Fri Oct 25 11:39:21 PDT 2024
================
@@ -0,0 +1,121 @@
+// Use --mlir-disable-threading so that the AA queries are serialized
+// as well as its diagnostic output.
+// RUN: fir-opt %s -pass-pipeline='builtin.module(func.func(test-fir-alias-analysis))' -split-input-file --mlir-disable-threading 2>&1 | FileCheck %s
+
+// Fortran code:
+//
+// program main
+// integer :: arrayA(10,10)
+// integer :: tmp(2)
+// integer :: i,j
+// !$omp teams distribute parallel do private(tmp)
+// do j = 1, 10
+// do i = 1,10
+// tmp = [i,j]
+// arrayA = tmp(1)
+// end do
+// end do
+// end program main
+
+// CHECK-LABEL: Testing : "_QQmain"
+// CHECK-DAG: tmp_private_array#0 <-> unnamed_array#0: NoAlias
+// CHECK-DAG: tmp_private_array#1 <-> unnamed_array#0: NoAlias
----------------
jeanPerier wrote:
Can you add a positive case? I understand NoAlias is what matter from an optimization point of view, but MayAlias is the most important to prove from a correctness point of view, so I think it is always good to add both negative and positive test cases here.
https://github.com/llvm/llvm-project/pull/113566
More information about the flang-commits
mailing list