1 //===- CastInterfaces.h - Cast Interfaces for MLIR --------------*- C++ -*-===// 2 // 3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 // See https://llvm.org/LICENSE.txt for license information. 5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 // 7 //===----------------------------------------------------------------------===// 8 // 9 // This file contains the definitions of the cast interfaces defined in 10 // `CastInterfaces.td`. 11 // 12 //===----------------------------------------------------------------------===// 13 14 #ifndef MLIR_INTERFACES_CASTINTERFACES_H 15 #define MLIR_INTERFACES_CASTINTERFACES_H 16 17 #include "mlir/IR/OpDefinition.h" 18 19 namespace mlir { 20 class DialectRegistry; 21 22 namespace impl { 23 /// Attempt to fold the given cast operation. 24 LogicalResult foldCastInterfaceOp(Operation *op, 25 ArrayRef<Attribute> attrOperands, 26 SmallVectorImpl<OpFoldResult> &foldResults); 27 28 /// Attempt to verify the given cast operation. 29 LogicalResult verifyCastInterfaceOp(Operation *op); 30 } // namespace impl 31 32 namespace builtin { 33 void registerCastOpInterfaceExternalModels(DialectRegistry ®istry); 34 } // namespace builtin 35 } // namespace mlir 36 37 /// Include the generated interface declarations. 38 #include "mlir/Interfaces/CastInterfaces.h.inc" 39 40 #endif // MLIR_INTERFACES_CASTINTERFACES_H 41