projects
/
platform
/
upstream
/
llvm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e2af847
)
Use hasRank instead of comparing rank to -1
author
Geoffrey Martin-Noble
<gcmn@google.com>
Thu, 30 May 2019 00:15:51 +0000
(17:15 -0700)
committer
Mehdi Amini
<joker.eph@gmail.com>
Sun, 2 Jun 2019 03:10:03 +0000
(20:10 -0700)
--
PiperOrigin-RevId:
250598252
mlir/lib/StandardOps/Ops.cpp
patch
|
blob
|
history
diff --git
a/mlir/lib/StandardOps/Ops.cpp
b/mlir/lib/StandardOps/Ops.cpp
index
94f5a67
..
66a1226
100644
(file)
--- 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();