[flang-commits] [flang] [Flang][OpenMP] Remove omp.simd reduction block args (PR #111523)

Sergio Afonso via flang-commits flang-commits at lists.llvm.org
Tue Oct 8 04:44:20 PDT 2024


https://github.com/skatrak created https://github.com/llvm/llvm-project/pull/111523

This patch reverts previous changes to create entry block arguments for reduction variables attached to `simd` constructs.

This can't currently be done because reduction variables stored in the corresponding clause structure are not added to the `omp.simd` operation when created, as this is not supported yet. Adding block arguments for non-existent reduction variables results in some tests from the Fujitsu compiler testsuite breaking: https://linaro.atlassian.net/browse/LLVM-1389.

>From 7574f3be5783823d1fa29ea24c9fe71b727ede68 Mon Sep 17 00:00:00 2001
From: Sergio Afonso <safonsof at amd.com>
Date: Tue, 8 Oct 2024 12:37:50 +0100
Subject: [PATCH] [Flang][OpenMP] Remove omp.simd reduction block args

This patch reverts previous changes to create entry block arguments for
reduction variables attached to `simd` constructs.

This can't currently be done because reduction variables stored in the
corresponding clause structure are not added to the `omp.simd` operation when
created, as this is not supported yet. Adding block arguments for non-existent
reduction variables results in some tests from the Fujitsu compiler testsuite
breaking: https://linaro.atlassian.net/browse/LLVM-1389.
---
 flang/lib/Lower/OpenMP/OpenMP.cpp | 16 ++++------------
 1 file changed, 4 insertions(+), 12 deletions(-)

diff --git a/flang/lib/Lower/OpenMP/OpenMP.cpp b/flang/lib/Lower/OpenMP/OpenMP.cpp
index b1a10960c8022e..1ce744457160b4 100644
--- a/flang/lib/Lower/OpenMP/OpenMP.cpp
+++ b/flang/lib/Lower/OpenMP/OpenMP.cpp
@@ -2072,9 +2072,7 @@ static void genStandaloneSimd(lower::AbstractConverter &converter,
                      loopNestClauseOps, iv);
 
   EntryBlockArgs simdArgs;
-  // TODO: Add private syms and vars.
-  simdArgs.reduction.syms = simdReductionSyms;
-  simdArgs.reduction.vars = simdClauseOps.reductionVars;
+  // TODO: Add private, reduction syms and vars.
   auto simdOp =
       genWrapperOp<mlir::omp::SimdOp>(converter, loc, simdClauseOps, simdArgs);
 
@@ -2232,9 +2230,7 @@ static void genCompositeDistributeParallelDoSimd(
   wsloopOp.setComposite(/*val=*/true);
 
   EntryBlockArgs simdArgs;
-  // TODO: Add private syms and vars.
-  simdArgs.reduction.syms = simdReductionSyms;
-  simdArgs.reduction.vars = simdClauseOps.reductionVars;
+  // TODO: Add private, reduction syms and vars.
   auto simdOp =
       genWrapperOp<mlir::omp::SimdOp>(converter, loc, simdClauseOps, simdArgs);
   simdOp.setComposite(/*val=*/true);
@@ -2291,9 +2287,7 @@ static void genCompositeDistributeSimd(lower::AbstractConverter &converter,
   distributeOp.setComposite(/*val=*/true);
 
   EntryBlockArgs simdArgs;
-  // TODO: Add private syms and vars.
-  simdArgs.reduction.syms = simdReductionSyms;
-  simdArgs.reduction.vars = simdClauseOps.reductionVars;
+  // TODO: Add private, reduction syms and vars.
   auto simdOp =
       genWrapperOp<mlir::omp::SimdOp>(converter, loc, simdClauseOps, simdArgs);
   simdOp.setComposite(/*val=*/true);
@@ -2350,9 +2344,7 @@ static void genCompositeDoSimd(lower::AbstractConverter &converter,
   wsloopOp.setComposite(/*val=*/true);
 
   EntryBlockArgs simdArgs;
-  // TODO: Add private syms and vars.
-  simdArgs.reduction.syms = simdReductionSyms;
-  simdArgs.reduction.vars = simdClauseOps.reductionVars;
+  // TODO: Add private, reduction syms and vars.
   auto simdOp =
       genWrapperOp<mlir::omp::SimdOp>(converter, loc, simdClauseOps, simdArgs);
   simdOp.setComposite(/*val=*/true);



More information about the flang-commits mailing list