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:
747b047
)
Avoid one branch in Operation::getOpOperand()/getOperand() (NFC)
author
Mehdi Amini
<joker.eph@gmail.com>
Wed, 13 Oct 2021 09:06:59 +0000
(09:06 +0000)
committer
Mehdi Amini
<joker.eph@gmail.com>
Wed, 13 Oct 2021 09:07:06 +0000
(09:07 +0000)
Skip the check on "hasOperandStorage" since the array will be indexed anyway.
Reviewed By: rriddle
Differential Revision: https://reviews.llvm.org/
D111696
mlir/include/mlir/IR/Operation.h
patch
|
blob
|
history
diff --git
a/mlir/include/mlir/IR/Operation.h
b/mlir/include/mlir/IR/Operation.h
index ac55edd9b00339afe200ccaa2bc09b15dce8bb51..d9ba5985aae65bb8580b5a8671ca24fd61463c8a 100644
(file)
--- a/
mlir/include/mlir/IR/Operation.h
+++ b/
mlir/include/mlir/IR/Operation.h
@@
-264,7
+264,9
@@
public:
: MutableArrayRef<OpOperand>();
}
- OpOperand &getOpOperand(unsigned idx) { return getOpOperands()[idx]; }
+ OpOperand &getOpOperand(unsigned idx) {
+ return getOperandStorage().getOperands()[idx];
+ }
// Support operand type iteration.
using operand_type_iterator = operand_range::type_iterator;