================
@@ -398,11 +400,39 @@ struct ParallelOpLowering : public 
OpRewritePattern<scf::ParallelOp> {
     // Replace the reduction operations contained in this loop. Must be done
     // here rather than in a separate pattern to have access to the list of
     // reduction variables.
+    unsigned int reductionIndex = 0;
     for (auto [x, y] :
          llvm::zip_equal(reductionVariables, reduce.getOperands())) {
       OpBuilder::InsertionGuard guard(rewriter);
       rewriter.setInsertionPoint(reduce);
-      rewriter.create<omp::ReductionOp>(reduce.getLoc(), y, x);
+      Region &redRegion =
+          ompReductionDecls[reductionIndex].getReductionRegion();
+      assert(redRegion.hasOneBlock() &&
+             "expect reduction region to have one block");
----------------
tblah wrote:

Please could you add a comment explaining why a reduction region must have only 
one block, or adding a TODO for multiple blocks.

https://github.com/llvm/llvm-project/pull/80019
_______________________________________________
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

Reply via email to