[flang] [llvm] [mlir] [flang][MLIR][OpenMP] make reduction by-ref toggled per variable (PR #92244)
    Tom Eccles via llvm-commits 
    llvm-commits at lists.llvm.org
       
    Thu May 16 03:49:52 PDT 2024
    
    
  
================
@@ -1488,6 +1520,13 @@ LogicalResult ParallelOp::verify() {
   if (failed(verifyPrivateVarList(*this)))
     return failure();
 
+  auto reductionVarsByRef = getReductionVarsByref();
+  if (reductionVarsByRef &&
+      reductionVarsByRef->size() != getReductionVars().size())
+    return emitOpError()
+           << "expected as many reduction variable by reference attributes "
+              "as reduction variables";
+
----------------
tblah wrote:
I couldn't think of a way to test for this error because we can't write text-form IR like this. I would have to create the operation with C++ like in a unit test, but I didn't know how to catch an error from a unit test.
https://github.com/llvm/llvm-project/pull/92244
    
    
More information about the llvm-commits
mailing list