Changeset View
Changeset View
Standalone View
Standalone View
mlir/include/mlir/Interfaces/CallInterfaces.td
Show First 20 Lines • Show All 45 Lines • ▼ Show 20 Lines | InterfaceMethod<[{ | ||||
"Operation::operand_range", "getArgOperands" | "Operation::operand_range", "getArgOperands" | ||||
>, | >, | ||||
InterfaceMethod<[{ | InterfaceMethod<[{ | ||||
Resolve the callable operation for given callee to a | Resolve the callable operation for given callee to a | ||||
CallableOpInterface, or nullptr if a valid callable was not resolved. | CallableOpInterface, or nullptr if a valid callable was not resolved. | ||||
}], | }], | ||||
"Operation *", "resolveCallable", (ins), [{ | "Operation *", "resolveCallable", (ins), [{ | ||||
// If the callable isn't a value, lookup the symbol reference. | // If the callable isn't a value, lookup the symbol reference. | ||||
CallInterfaceCallable callable = op.getCallableForCallee(); | CallInterfaceCallable callable = $_op.getCallableForCallee(); | ||||
if (auto symbolRef = callable.dyn_cast<SymbolRefAttr>()) | if (auto symbolRef = callable.dyn_cast<SymbolRefAttr>()) | ||||
return SymbolTable::lookupNearestSymbolFrom(op, symbolRef); | return SymbolTable::lookupNearestSymbolFrom($_op, symbolRef); | ||||
return callable.get<Value>().getDefiningOp(); | return callable.get<Value>().getDefiningOp(); | ||||
}] | }] | ||||
>, | >, | ||||
]; | ]; | ||||
} | } | ||||
/// Interface for callable operations. | /// Interface for callable operations. | ||||
def CallableOpInterface : OpInterface<"CallableOpInterface"> { | def CallableOpInterface : OpInterface<"CallableOpInterface"> { | ||||
Show All 27 Lines |