[Mlir-commits] [mlir] 8c176b6 - [mlir] Catch async.yield operands not matching the number of async.execute results.

Christian Sigg llvmlistbot at llvm.org
Tue Oct 27 11:39:43 PDT 2020


Author: Christian Sigg
Date: 2020-10-27T19:39:34+01:00
New Revision: 8c176b60298675864caec9c4c479033d282cb282

URL: https://github.com/llvm/llvm-project/commit/8c176b60298675864caec9c4c479033d282cb282
DIFF: https://github.com/llvm/llvm-project/commit/8c176b60298675864caec9c4c479033d282cb282.diff

LOG: [mlir] Catch async.yield operands not matching the number of async.execute results.

Reviewed By: ezhulenev

Differential Revision: https://reviews.llvm.org/D90211

Added: 
    

Modified: 
    mlir/lib/Dialect/Async/IR/Async.cpp

Removed: 
    


################################################################################
diff  --git a/mlir/lib/Dialect/Async/IR/Async.cpp b/mlir/lib/Dialect/Async/IR/Async.cpp
index 754665d8bafc..5ef3931ae3fd 100644
--- a/mlir/lib/Dialect/Async/IR/Async.cpp
+++ b/mlir/lib/Dialect/Async/IR/Async.cpp
@@ -105,8 +105,8 @@ static LogicalResult verify(YieldOp op) {
     return result.getType().cast<ValueType>().getValueType();
   });
 
-  if (!std::equal(types.begin(), types.end(), op.getOperandTypes().begin()))
-    return op.emitOpError("Operand types do not match the types returned from "
+  if (op.getOperandTypes() != types)
+    return op.emitOpError("operand types do not match the types returned from "
                           "the parent ExecuteOp");
 
   return success();
@@ -238,12 +238,7 @@ static LogicalResult verify(ExecuteOp op) {
   });
 
   // Verify that unwrapped argument types matches the body region arguments.
-  if (llvm::size(unwrappedTypes) != llvm::size(op.body().getArgumentTypes()))
-    return op.emitOpError("the number of async body region arguments does not "
-                          "match the number of execute operation arguments");
-
-  if (!std::equal(unwrappedTypes.begin(), unwrappedTypes.end(),
-                  op.body().getArgumentTypes().begin()))
+  if (op.body().getArgumentTypes() != unwrappedTypes)
     return op.emitOpError("async body region argument types do not match the "
                           "execute operation arguments types");
 


        


More information about the Mlir-commits mailing list