[flang-commits] [flang] [Flang][HLFIR][OpenMP] Fix offloading tests broken by HLFIR (PR #69457)

Sergio Afonso via flang-commits flang-commits at lists.llvm.org
Fri Oct 20 04:11:21 PDT 2023


================
@@ -1,9 +1,9 @@
-! RUN: %flang_fc1 -fopenmp -emit-llvm %s -o - | FileCheck --check-prefix=LLVM %s
-! RUN: %flang_fc1 -fopenmp -emit-mlir %s -o - | FileCheck --check-prefix=MLIR %s
-! RUN: %flang_fc1 -fopenmp -fopenmp-is-target-device -emit-llvm %s -o - | FileCheck --check-prefix=LLVM %s
-! RUN: %flang_fc1 -fopenmp -fopenmp-is-target-device -emit-mlir %s -o - | FileCheck --check-prefix=MLIR %s
-! RUN: bbc -fopenmp -emit-fir %s -o - | FileCheck --check-prefixes=MLIR-HOST,MLIR-ALL %s
-! RUN: bbc -fopenmp -fopenmp-is-target-device -emit-fir %s -o - | FileCheck --check-prefixes=MLIR-DEVICE,MLIR-ALL %s
+! RUN: %flang_fc1 -fopenmp -flang-experimental-hlfir -emit-llvm %s -o - | FileCheck --check-prefix=LLVM %s
----------------
skatrak wrote:

These tests together with HLFIR seemed to uncover some limitations of the OpenMP to LLVM IR translation, but I was able to address this in this latest review of the patch. So they now compile and run with the -flang-experimental-hlfir option set.

One thing I noticed is that the double-target-call-with-declare-target.f90 test produces the expected results only if running on an accelerator. Running it in the host by setting the `OMP_TARGET_OFFLOAD=DISABLED` env variable will print out the wrong result. This does not change whether HLFIR is used or not, so it seems unrelated to this patch. I'll try to run it on a clean main build without this patch to confirm this.

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


More information about the flang-commits mailing list