From d407a85169a4fa4cb28c1203ce50af2546c088b8 Mon Sep 17 00:00:00 2001 From: Geoffrey Martin-Noble Date: Wed, 29 May 2019 17:15:51 -0700 Subject: [PATCH] Use hasRank instead of comparing rank to -1 -- PiperOrigin-RevId: 250598252 --- mlir/lib/StandardOps/Ops.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mlir/lib/StandardOps/Ops.cpp b/mlir/lib/StandardOps/Ops.cpp index 94f5a67b..66a1226 100644 --- a/mlir/lib/StandardOps/Ops.cpp +++ b/mlir/lib/StandardOps/Ops.cpp @@ -1600,8 +1600,8 @@ static LogicalResult verify(ExtractElementOp op) { return op.emitOpError("index to extract_element must have 'index' type"); // Verify the # indices match if we have a ranked type. - auto aggregateRank = aggregateType.getRank(); - if (aggregateRank != -1 && aggregateRank != op.getNumOperands() - 1) + if (aggregateType.hasRank() && + aggregateType.getRank() != op.getNumOperands() - 1) return op.emitOpError("incorrect number of indices for extract_element"); return success(); -- 2.7.4