27 ::mlir::LogicalResult (*
verifyTemplateParamsMatchInferred)(
const Concept *
impl, ::mlir::Operation *, ::llvm::iterator_range<::mlir::Region::op_iterator<::llzk::polymorphic::TemplateParamOp>>, const ::llzk::UnificationMap &);
35 assert(
implArgAndResultAttrsOpInterface &&
"`::llzk::LLZKCallLikeOpInterface` expected its base interface `::mlir::ArgAndResultAttrsOpInterface` to be registered");
37 assert(
implCallOpInterface &&
"`::llzk::LLZKCallLikeOpInterface` expected its base interface `::mlir::CallOpInterface` to be registered");
39 assert(
implSymbolUserOpInterface &&
"`::llzk::LLZKCallLikeOpInterface` expected its base interface `::mlir::SymbolUserOpInterface` to be registered");
42 template<
typename ConcreteOp>
50 static inline ::mlir::FailureOr<::llzk::UnificationMap>
unifyTypeSignatureWithNamespace(
const Concept *
impl, ::mlir::Operation *tablegen_opaque_val, ::mlir::FunctionType other, ::mlir::ArrayRef<::llvm::StringRef> rhsReversePrefix);
51 static inline ::mlir::FailureOr<::llzk::UnificationMap>
unifyTypeSignature(
const Concept *
impl, ::mlir::Operation *tablegen_opaque_val, ::mlir::FunctionType other);
52 static inline ::llvm::SmallVector<::mlir::ValueRange>
toVectorOfValueRange(::mlir::OperandRangeRange input);
54 static inline ::mlir::LogicalResult
verifyTemplateParamValuesCompatibility(
const Concept *
impl, ::mlir::Operation *tablegen_opaque_val, ::llvm::iterator_range<::mlir::Region::op_iterator<::llzk::polymorphic::TemplateParamOp>> targetParamDefs);
55 static inline ::mlir::LogicalResult
verifyTemplateParamsMatchInferred(
const Concept *
impl, ::mlir::Operation *tablegen_opaque_val, ::llvm::iterator_range<::mlir::Region::op_iterator<::llzk::polymorphic::TemplateParamOp>> targetParamDefs, const ::llzk::UnificationMap & unifications);
57 template<
typename ConcreteOp>
65 static inline ::mlir::FailureOr<::llzk::UnificationMap>
unifyTypeSignatureWithNamespace(
const Concept *
impl, ::mlir::Operation *tablegen_opaque_val, ::mlir::FunctionType other, ::mlir::ArrayRef<::llvm::StringRef> rhsReversePrefix);
66 static inline ::mlir::FailureOr<::llzk::UnificationMap>
unifyTypeSignature(
const Concept *
impl, ::mlir::Operation *tablegen_opaque_val, ::mlir::FunctionType other);
67 static inline ::llvm::SmallVector<::mlir::ValueRange>
toVectorOfValueRange(::mlir::OperandRangeRange input);
70 static inline ::mlir::LogicalResult
verifyTemplateParamsMatchInferred(
const Concept *
impl, ::mlir::Operation *tablegen_opaque_val, ::llvm::iterator_range<::mlir::Region::op_iterator<::llzk::polymorphic::TemplateParamOp>> targetParamDefs, const ::llzk::UnificationMap & unifications);
72 template<
typename ConcreteModel,
typename ConcreteOp>
76 ::mlir::FunctionType
getTypeSignature(::mlir::Operation *tablegen_opaque_val)
const;
77 ::mlir::FailureOr<::llzk::UnificationMap>
unifyTypeSignatureWithNamespace(::mlir::Operation *tablegen_opaque_val, ::mlir::FunctionType other, ::mlir::ArrayRef<::llvm::StringRef> rhsReversePrefix)
const;
78 ::mlir::FailureOr<::llzk::UnificationMap>
unifyTypeSignature(::mlir::Operation *tablegen_opaque_val, ::mlir::FunctionType other)
const;
79 static ::llvm::SmallVector<::mlir::ValueRange>
toVectorOfValueRange(::mlir::OperandRangeRange input);
81 ::mlir::LogicalResult
verifyTemplateParamValuesCompatibility(::mlir::Operation *tablegen_opaque_val, ::llvm::iterator_range<::mlir::Region::op_iterator<::llzk::polymorphic::TemplateParamOp>> targetParamDefs)
const;
82 ::mlir::LogicalResult
verifyTemplateParamsMatchInferred(::mlir::Operation *tablegen_opaque_val, ::llvm::iterator_range<::mlir::Region::op_iterator<::llzk::polymorphic::TemplateParamOp>> targetParamDefs, const ::llzk::UnificationMap &unifications)
const;
85template <
typename ConcreteOp>
89class LLZKCallLikeOpInterface :
public ::mlir::OpInterface<LLZKCallLikeOpInterface, detail::LLZKCallLikeOpInterfaceInterfaceTraits> {
91 using ::mlir::OpInterface<LLZKCallLikeOpInterface, detail::LLZKCallLikeOpInterfaceInterfaceTraits>::OpInterface;
92 template <
typename ConcreteOp>
103 ::mlir::FailureOr<::llzk::UnificationMap>
unifyTypeSignatureWithNamespace(::mlir::FunctionType other, ::mlir::ArrayRef<::llvm::StringRef> rhsReversePrefix);
106 ::mlir::FailureOr<::llzk::UnificationMap>
unifyTypeSignature(::mlir::FunctionType other);
127 ::mlir::LogicalResult
verifyTemplateParamsMatchInferred(::llvm::iterator_range<::mlir::Region::op_iterator<::llzk::polymorphic::TemplateParamOp>> targetParamDefs, const ::llzk::UnificationMap & unifications);
132 operator ::mlir::ArgAndResultAttrsOpInterface ()
const {
133 if (!*
this)
return nullptr;
134 return ::mlir::ArgAndResultAttrsOpInterface(*
this, getImpl()->implArgAndResultAttrsOpInterface);
169 operator ::mlir::CallOpInterface ()
const {
170 if (!*
this)
return nullptr;
171 return ::mlir::CallOpInterface(*
this, getImpl()->implCallOpInterface);
209 operator ::mlir::SymbolUserOpInterface ()
const {
210 if (!*
this)
return nullptr;
211 return ::mlir::SymbolUserOpInterface(*
this, getImpl()->implSymbolUserOpInterface);
216 ::llvm::LogicalResult
verifySymbolUses(::mlir::SymbolTableCollection & symbolTable);
222 template <
typename ConcreteOp>
223 struct LLZKCallLikeOpInterfaceTrait :
public ::mlir::OpInterface<LLZKCallLikeOpInterface, detail::LLZKCallLikeOpInterfaceInterfaceTraits>::Trait<ConcreteOp> {
227 return ::mlir::FunctionType::get(
228 (*
static_cast<ConcreteOp *
>(
this)).getContext(),
229 (*
static_cast<ConcreteOp *
>(
this)).getArgOperands().getTypes(),
230 (*
static_cast<ConcreteOp *
>(
this))->getResultTypes());
240 return ::mlir::failure();
246 return (*
static_cast<ConcreteOp *
>(
this)).unifyTypeSignatureWithNamespace(other, {});
252 ::llvm::SmallVector<::mlir::ValueRange, 4> output;
253 output.reserve(input.size());
254 output.insert(output.end(), input.begin(), input.end());
260 return ::llzk::verifyTemplateParamValueCompatibility(
261 (*
static_cast<ConcreteOp *
>(
this)).getOperation(), paramFromCallOp, targetParam);
270 return ::llzk::verifyTemplateParamValuesCompatibility(
271 (*
static_cast<ConcreteOp *
>(
this)).getOperation(), (*
static_cast<ConcreteOp *
>(
this)).getTemplateParamsAttr(), targetParamDefs);
279 ::mlir::LogicalResult
verifyTemplateParamsMatchInferred(::llvm::iterator_range<::mlir::Region::op_iterator<::llzk::polymorphic::TemplateParamOp>> targetParamDefs, const ::llzk::UnificationMap & unifications) {
280 return ::llzk::verifyTemplateParamsMatchInferred(
281 (*
static_cast<ConcreteOp *
>(
this)).getOperation(), (*
static_cast<ConcreteOp *
>(
this)).getTemplateParamsAttr(), targetParamDefs, unifications);
288template<
typename ConcreteOp>
290 return (llvm::cast<ConcreteOp>(tablegen_opaque_val)).getSelfValue();
292template<
typename ConcreteOp>
294 return (llvm::cast<ConcreteOp>(tablegen_opaque_val)).getTypeSignature();
296template<
typename ConcreteOp>
298 return (llvm::cast<ConcreteOp>(tablegen_opaque_val)).unifyTypeSignatureWithNamespace(other, rhsReversePrefix);
300template<
typename ConcreteOp>
302 return (llvm::cast<ConcreteOp>(tablegen_opaque_val)).unifyTypeSignature(other);
304template<
typename ConcreteOp>
306 return ConcreteOp::toVectorOfValueRange(input);
308template<
typename ConcreteOp>
310 return (llvm::cast<ConcreteOp>(tablegen_opaque_val)).verifyTemplateParamValueCompatibility(paramFromCallOp, targetParam);
312template<
typename ConcreteOp>
314 return (llvm::cast<ConcreteOp>(tablegen_opaque_val)).verifyTemplateParamValuesCompatibility(targetParamDefs);
316template<
typename ConcreteOp>
318 return (llvm::cast<ConcreteOp>(tablegen_opaque_val)).verifyTemplateParamsMatchInferred(targetParamDefs, unifications);
320template<
typename ConcreteOp>
322 return static_cast<const ConcreteOp *
>(
impl)->
getSelfValue(tablegen_opaque_val);
324template<
typename ConcreteOp>
328template<
typename ConcreteOp>
332template<
typename ConcreteOp>
336template<
typename ConcreteOp>
338 return ConcreteOp::toVectorOfValueRange(input);
340template<
typename ConcreteOp>
344template<
typename ConcreteOp>
348template<
typename ConcreteOp>
352template<
typename ConcreteModel,
typename ConcreteOp>
354return ::mlir::FunctionType::get(
355 (llvm::cast<ConcreteOp>(tablegen_opaque_val)).getContext(),
356 (llvm::cast<ConcreteOp>(tablegen_opaque_val)).getArgOperands().getTypes(),
357 (llvm::cast<ConcreteOp>(tablegen_opaque_val))->getResultTypes());
359template<
typename ConcreteModel,
typename ConcreteOp>
365 return ::mlir::failure();
368template<
typename ConcreteModel,
typename ConcreteOp>
370return (llvm::cast<ConcreteOp>(tablegen_opaque_val)).unifyTypeSignatureWithNamespace(other, {});
372template<
typename ConcreteModel,
typename ConcreteOp>
374::llvm::SmallVector<::mlir::ValueRange, 4> output;
375 output.reserve(input.size());
376 output.insert(output.end(), input.begin(), input.end());
379template<
typename ConcreteModel,
typename ConcreteOp>
381return ::llzk::verifyTemplateParamValueCompatibility(
382 (llvm::cast<ConcreteOp>(tablegen_opaque_val)).getOperation(), paramFromCallOp, targetParam);
384template<
typename ConcreteModel,
typename ConcreteOp>
386return ::llzk::verifyTemplateParamValuesCompatibility(
387 (llvm::cast<ConcreteOp>(tablegen_opaque_val)).getOperation(), (llvm::cast<ConcreteOp>(tablegen_opaque_val)).getTemplateParamsAttr(), targetParamDefs);
389template<
typename ConcreteModel,
typename ConcreteOp>
391return ::llzk::verifyTemplateParamsMatchInferred(
392 (llvm::cast<ConcreteOp>(tablegen_opaque_val)).getOperation(), (llvm::cast<ConcreteOp>(tablegen_opaque_val)).getTemplateParamsAttr(), targetParamDefs, unifications);
::mlir::ArrayAttr getResAttrsAttr()
Get the array of result attribute dictionaries.
::llvm::SmallVector<::mlir::ValueRange > toVectorOfValueRange(::mlir::OperandRangeRange input)
Allocates consecutive storage for operand groups so they can be passed to builders as an ArrayRef<Val...
::mlir::Value getSelfValue()
Returns the "self" value from the callee (or nullptr if it's not a struct target).
::mlir::CallInterfaceCallable getCallableForCallee()
Returns the callee of this call-like operation.
void setResAttrsAttr(::mlir::ArrayAttr attrs)
Set the array of result attribute dictionaries.
void setCalleeFromCallable(::mlir::CallInterfaceCallable callee)
Sets the callee of this call-like operation.
::mlir::MutableOperandRange getArgOperandsMutable()
Returns the operands within this call that are used as arguments to the callee as a mutable range.
::mlir::Attribute removeArgAttrsAttr()
Remove the array of argument attribute dictionaries.
::mlir::Attribute removeResAttrsAttr()
Remove the array of result attribute dictionaries.
::mlir::ArrayAttr getArgAttrsAttr()
Get the array of argument attribute dictionaries.
::mlir::LogicalResult verifyTemplateParamsMatchInferred(::llvm::iterator_range<::mlir::Region::op_iterator<::llzk::polymorphic::TemplateParamOp > > targetParamDefs, const ::llzk::UnificationMap &unifications)
Checks that explicit template parameters agree with their inferred values.
::mlir::FailureOr<::llzk::UnificationMap > unifyTypeSignatureWithNamespace(::mlir::FunctionType other, ::mlir::ArrayRef<::llvm::StringRef > rhsReversePrefix)
Unifies this call site's inferred signature with other, resolving paths in other relative to rhsRever...
::mlir::Operation * resolveCallableInTable(::mlir::SymbolTableCollection *symbolTable)
Resolve the callable operation for given callee to a CallableOpInterface, or nullptr if a valid calla...
::mlir::FailureOr<::llzk::UnificationMap > unifyTypeSignature(::mlir::FunctionType other)
Unifies this call site's inferred signature with other.
::mlir::FunctionType getTypeSignature()
Returns the function signature inferred from this call site.
::mlir::LogicalResult verifyTemplateParamValueCompatibility(::mlir::Attribute paramFromCallOp, ::llzk::polymorphic::TemplateParamOp targetParam)
Checks a template parameter value against the declared type of its target parameter.
::llvm::LogicalResult verifySymbolUses(::mlir::SymbolTableCollection &symbolTable)
Verify the symbol uses held by this operation.
void setArgAttrsAttr(::mlir::ArrayAttr attrs)
Set the array of argument attribute dictionaries.
::mlir::Operation::operand_range getArgOperands()
Returns the operands within this call that are used as arguments to the callee.
::mlir::LogicalResult verifyTemplateParamValuesCompatibility(::llvm::iterator_range<::mlir::Region::op_iterator<::llzk::polymorphic::TemplateParamOp > > targetParamDefs)
Checks each explicit template parameter against its corresponding declared parameter.
::mlir::Operation * resolveCallable()
Resolve the callable operation for given callee to a CallableOpInterface, or nullptr if a valid calla...
ConcreteOp ConcreteEntity
::mlir::FunctionType getTypeSignature(::mlir::Operation *tablegen_opaque_val) const
static inline ::mlir::LogicalResult verifyTemplateParamsMatchInferred(const Concept *impl, ::mlir::Operation *tablegen_opaque_val, ::llvm::iterator_range<::mlir::Region::op_iterator<::llzk::polymorphic::TemplateParamOp > > targetParamDefs, const ::llzk::UnificationMap &unifications)
static inline ::llvm::SmallVector<::mlir::ValueRange > toVectorOfValueRange(::mlir::OperandRangeRange input)
static inline ::mlir::FailureOr<::llzk::UnificationMap > unifyTypeSignature(const Concept *impl, ::mlir::Operation *tablegen_opaque_val, ::mlir::FunctionType other)
static inline ::mlir::LogicalResult verifyTemplateParamValueCompatibility(const Concept *impl, ::mlir::Operation *tablegen_opaque_val, ::mlir::Attribute paramFromCallOp, ::llzk::polymorphic::TemplateParamOp targetParam)
static inline ::mlir::FailureOr<::llzk::UnificationMap > unifyTypeSignatureWithNamespace(const Concept *impl, ::mlir::Operation *tablegen_opaque_val, ::mlir::FunctionType other, ::mlir::ArrayRef<::llvm::StringRef > rhsReversePrefix)
static inline ::mlir::LogicalResult verifyTemplateParamValuesCompatibility(const Concept *impl, ::mlir::Operation *tablegen_opaque_val, ::llvm::iterator_range<::mlir::Region::op_iterator<::llzk::polymorphic::TemplateParamOp > > targetParamDefs)
::llzk::LLZKCallLikeOpInterface Interface
static inline ::mlir::FunctionType getTypeSignature(const Concept *impl, ::mlir::Operation *tablegen_opaque_val)
static inline ::mlir::Value getSelfValue(const Concept *impl, ::mlir::Operation *tablegen_opaque_val)
static inline ::mlir::LogicalResult verifyTemplateParamValueCompatibility(const Concept *impl, ::mlir::Operation *tablegen_opaque_val, ::mlir::Attribute paramFromCallOp, ::llzk::polymorphic::TemplateParamOp targetParam)
::llzk::LLZKCallLikeOpInterface Interface
static inline ::mlir::FailureOr<::llzk::UnificationMap > unifyTypeSignatureWithNamespace(const Concept *impl, ::mlir::Operation *tablegen_opaque_val, ::mlir::FunctionType other, ::mlir::ArrayRef<::llvm::StringRef > rhsReversePrefix)
static inline ::mlir::FailureOr<::llzk::UnificationMap > unifyTypeSignature(const Concept *impl, ::mlir::Operation *tablegen_opaque_val, ::mlir::FunctionType other)
static inline ::mlir::LogicalResult verifyTemplateParamValuesCompatibility(const Concept *impl, ::mlir::Operation *tablegen_opaque_val, ::llvm::iterator_range<::mlir::Region::op_iterator<::llzk::polymorphic::TemplateParamOp > > targetParamDefs)
static inline ::mlir::Value getSelfValue(const Concept *impl, ::mlir::Operation *tablegen_opaque_val)
static inline ::llvm::SmallVector<::mlir::ValueRange > toVectorOfValueRange(::mlir::OperandRangeRange input)
static inline ::mlir::LogicalResult verifyTemplateParamsMatchInferred(const Concept *impl, ::mlir::Operation *tablegen_opaque_val, ::llvm::iterator_range<::mlir::Region::op_iterator<::llzk::polymorphic::TemplateParamOp > > targetParamDefs, const ::llzk::UnificationMap &unifications)
static inline ::mlir::FunctionType getTypeSignature(const Concept *impl, ::mlir::Operation *tablegen_opaque_val)
Provides the necessary information to the RemoveUnusedDiscardableAllocations pass about operations th...
LogicalResult verifyTemplateParamsMatchInferred(Operation *origin, ArrayAttr explicitParams, llvm::iterator_range< Region::op_iterator< TemplateParamOp > > targetParamDefs, const UnificationMap &unifications)
mlir::DenseMap< std::pair< mlir::SymbolRefAttr, Side >, mlir::Attribute > UnificationMap
Optional result from type unifications.
LogicalResult verifyTemplateParamValueCompatibility(Operation *origin, Attribute value, TemplateParamOp targetParam)
LogicalResult verifyTemplateParamValuesCompatibility(Operation *origin, ArrayAttr explicitParams, llvm::iterator_range< Region::op_iterator< TemplateParamOp > > targetParamDefs)
bool functionTypesUnify(FunctionType lhs, FunctionType rhs, ArrayRef< StringRef > rhsReversePrefix, UnificationMap *unifications)
const ::mlir::ArgAndResultAttrsOpInterface::Concept * implArgAndResultAttrsOpInterface
The base classes of this interface.
::mlir::LogicalResult(* verifyTemplateParamValuesCompatibility)(const Concept *impl, ::mlir::Operation *, ::llvm::iterator_range<::mlir::Region::op_iterator<::llzk::polymorphic::TemplateParamOp > >)
const ::mlir::CallOpInterface::Concept * implCallOpInterface
const ::mlir::SymbolUserOpInterface::Concept * implSymbolUserOpInterface
::mlir::FunctionType(* getTypeSignature)(const Concept *impl, ::mlir::Operation *)
::mlir::Value(* getSelfValue)(const Concept *impl, ::mlir::Operation *)
The methods defined by the interface.
::mlir::LogicalResult(* verifyTemplateParamsMatchInferred)(const Concept *impl, ::mlir::Operation *, ::llvm::iterator_range<::mlir::Region::op_iterator<::llzk::polymorphic::TemplateParamOp > >, const ::llzk::UnificationMap &)
::llvm::SmallVector<::mlir::ValueRange >(* toVectorOfValueRange)(::mlir::OperandRangeRange)
::mlir::FailureOr<::llzk::UnificationMap >(* unifyTypeSignatureWithNamespace)(const Concept *impl, ::mlir::Operation *, ::mlir::FunctionType, ::mlir::ArrayRef<::llvm::StringRef >)
::mlir::LogicalResult(* verifyTemplateParamValueCompatibility)(const Concept *impl, ::mlir::Operation *, ::mlir::Attribute, ::llzk::polymorphic::TemplateParamOp)
::mlir::FailureOr<::llzk::UnificationMap >(* unifyTypeSignature)(const Concept *impl, ::mlir::Operation *, ::mlir::FunctionType)
void initializeInterfaceConcept(::mlir::detail::InterfaceMap &interfaceMap)
::mlir::LogicalResult verifyTemplateParamValueCompatibility(::mlir::Attribute paramFromCallOp, ::llzk::polymorphic::TemplateParamOp targetParam)
Checks a template parameter value against the declared type of its target parameter.
static ::llvm::SmallVector<::mlir::ValueRange > toVectorOfValueRange(::mlir::OperandRangeRange input)
Allocates consecutive storage for operand groups so they can be passed to builders as an ArrayRef<Val...
::mlir::FailureOr<::llzk::UnificationMap > unifyTypeSignatureWithNamespace(::mlir::FunctionType other, ::mlir::ArrayRef<::llvm::StringRef > rhsReversePrefix)
Unifies this call site's inferred signature with other, resolving paths in other relative to rhsRever...
::mlir::FailureOr<::llzk::UnificationMap > unifyTypeSignature(::mlir::FunctionType other)
Unifies this call site's inferred signature with other.
::mlir::LogicalResult verifyTemplateParamValuesCompatibility(::llvm::iterator_range<::mlir::Region::op_iterator<::llzk::polymorphic::TemplateParamOp > > targetParamDefs)
Checks each explicit template parameter against its corresponding declared parameter.
::mlir::FunctionType getTypeSignature()
Returns the function signature inferred from this call site.
::mlir::LogicalResult verifyTemplateParamsMatchInferred(::llvm::iterator_range<::mlir::Region::op_iterator<::llzk::polymorphic::TemplateParamOp > > targetParamDefs, const ::llzk::UnificationMap &unifications)
Checks that explicit template parameters agree with their inferred values.