diff --git a/mlir/include/mlir/Dialect/OpenMP/OpenMPOps.td b/mlir/include/mlir/Dialect/OpenMP/OpenMPOps.td --- a/mlir/include/mlir/Dialect/OpenMP/OpenMPOps.td +++ b/mlir/include/mlir/Dialect/OpenMP/OpenMPOps.td @@ -823,7 +823,7 @@ /// The i-th variable operand passed. Value getVariableOperand(unsigned i) { - assert(0 <= i < 2 && "invalid index position for an operand"); + assert(0 <= i && i < 2 && "invalid index position for an operand"); return i == 0 ? x() : v(); } }]; @@ -871,7 +871,7 @@ /// The i-th variable operand passed. Value getVariableOperand(unsigned i) { - assert(0 <= i < 2 && "invalid index position for an operand"); + assert(0 <= i && i < 2 && "invalid index position for an operand"); return i == 0 ? address() : value(); } }]; diff --git a/mlir/lib/Conversion/OpenMPToLLVM/OpenMPToLLVM.cpp b/mlir/lib/Conversion/OpenMPToLLVM/OpenMPToLLVM.cpp --- a/mlir/lib/Conversion/OpenMPToLLVM/OpenMPToLLVM.cpp +++ b/mlir/lib/Conversion/OpenMPToLLVM/OpenMPToLLVM.cpp @@ -63,7 +63,8 @@ return failure(); if (originalVariableOperand.getType().isa()) { // TODO: Support memref type in variable operands - rewriter.notifyMatchFailure(curOp, "memref is not supported yet"); + return rewriter.notifyMatchFailure(curOp, + "memref is not supported yet"); } else { convertedOperands.emplace_back(adaptor.getOperands()[idx]); }