Avoid one branch in Operation::getOpOperand()/getOperand() (NFC)

Skip the check on "hasOperandStorage" since the array will be indexed anyway.

Reviewed By: rriddle

Differential Revision: https://reviews.llvm.org/D111696
This commit is contained in:
Mehdi Amini 2021-10-13 09:06:59 +00:00
parent 747b047290
commit 6f5c685839
1 changed files with 3 additions and 1 deletions

View File

@ -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;