Skip to content

Commit b59af5c

Browse files
committed
[MLIR] Apply clang-tidy fixes for readability-simplify-boolean-expr in LinalgInterfaces.cpp (NFC)
1 parent 5a339b0 commit b59af5c

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

mlir/lib/Dialect/Linalg/IR/LinalgInterfaces.cpp

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -248,10 +248,8 @@ static bool isaElemwiseSingleUnaryOrBinaryOpInterface(linalg::GenericOp op,
248248
return false;
249249

250250
auto yieldOp = dyn_cast<linalg::YieldOp>(body->back());
251-
if (!yieldOp || yieldOp.getNumOperands() != 1 ||
252-
yieldOp->getOperand(0).getDefiningOp() != oper)
253-
return false;
254-
return true;
251+
return !(!yieldOp || yieldOp.getNumOperands() != 1 ||
252+
yieldOp->getOperand(0).getDefiningOp() != oper);
255253
}
256254

257255
bool linalg::isaElemwiseSingleUnaryOpInterface(linalg::GenericOp op) {
@@ -272,10 +270,8 @@ bool linalg::isaElemwiseSingleBinaryOpInterface(linalg::GenericOp op) {
272270
// Check both inputs are used (elementwise).
273271
OpOperand *inputOpOperand0 = op.getDpsInputOperand(0);
274272
OpOperand *inputOpOperand1 = op.getDpsInputOperand(1);
275-
if (!op.payloadUsesValueFromOperand(inputOpOperand0) ||
276-
!op.payloadUsesValueFromOperand(inputOpOperand1))
277-
return false;
278-
return true;
273+
return !(!op.payloadUsesValueFromOperand(inputOpOperand0) ||
274+
!op.payloadUsesValueFromOperand(inputOpOperand1));
279275
}
280276

281277
//===----------------------------------------------------------------------===//

0 commit comments

Comments
 (0)