mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2024-11-29 16:41:27 +00:00
[mlir][Linalg] NFC - Add isOutputTensor to LinalgInterfaces.td
This commit is contained in:
parent
3ea0e119b9
commit
05882157db
@ -677,6 +677,22 @@ def LinalgStructuredInterface : OpInterface<"LinalgOp"> {
|
||||
return false;
|
||||
}]
|
||||
>,
|
||||
InterfaceMethod<
|
||||
/*desc=*/[{
|
||||
Return true if `opOperand` is an output tensor.
|
||||
}],
|
||||
/*retTy=*/"bool",
|
||||
/*methodName=*/"isOutputTensor",
|
||||
/*args=*/(ins "OpOperand *":$opOperand),
|
||||
/*methodBody=*/"",
|
||||
/*defaultImplementation=*/[{
|
||||
if (!opOperand->get().getType().template isa<RankedTensorType>())
|
||||
return false;
|
||||
if (opOperand->getOperandNumber() >= $_op.getNumInputs())
|
||||
return true;
|
||||
return false;
|
||||
}]
|
||||
>,
|
||||
InterfaceMethod<
|
||||
/*desc=*/[{
|
||||
Return true if `opOperand` is an init tensor. This is true when it is
|
||||
@ -687,9 +703,7 @@ def LinalgStructuredInterface : OpInterface<"LinalgOp"> {
|
||||
/*args=*/(ins "OpOperand *":$opOperand),
|
||||
/*methodBody=*/"",
|
||||
/*defaultImplementation=*/[{
|
||||
if (!opOperand->get().getType().template isa<RankedTensorType>())
|
||||
return false;
|
||||
if (opOperand->getOperandNumber() < $_op.getNumInputs())
|
||||
if (!$_op.isOutputTensor(opOperand))
|
||||
return false;
|
||||
return payloadUsesValueFromOpOperand(opOperand);
|
||||
}]
|
||||
|
Loading…
Reference in New Issue
Block a user