diff --git a/mlir/include/mlir/Dialect/Linalg/IR/LinalgInterfaces.td b/mlir/include/mlir/Dialect/Linalg/IR/LinalgInterfaces.td --- a/mlir/include/mlir/Dialect/Linalg/IR/LinalgInterfaces.td +++ b/mlir/include/mlir/Dialect/Linalg/IR/LinalgInterfaces.td @@ -691,13 +691,11 @@ /*methodBody=*/"", /*defaultImplementation=*/[{ return this->getOperation()->getNumResults() == 0 && - llvm::all_of(getInputOperands(), [&](OpOperand *opOperand) { - return isScalar(opOperand) || - opOperand->get().getType().template isa(); - }) && - llvm::all_of(getOutputOperands(), [](OpOperand *opOperand) { - return opOperand->get().getType().template isa(); - }); + llvm::all_of(this->getOperation()->getOpOperands(), + [&](OpOperand &opOperand) { + return isScalar(&opOperand) || + opOperand.get().getType().template isa(); + }); }] >, InterfaceMethod< @@ -709,13 +707,10 @@ /*args=*/(ins), /*methodBody=*/"", /*defaultImplementation=*/[{ - return - llvm::all_of(getInputOperands(), [&](OpOperand *opOperand) { - return isScalar(opOperand) || - opOperand->get().getType().template isa(); - }) && - llvm::all_of(getOutputOperands(), [](OpOperand *opOperand) { - return opOperand->get().getType().template isa(); + return llvm::all_of(this->getOperation()->getOpOperands(), + [&](OpOperand &opOperand) { + return isScalar(&opOperand) || + opOperand.get().getType().template isa(); }); }] >,