1 //===-- Optimizer/Dialect/FIROps.h - FIR operations -------------*- 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 #ifndef OPTIMIZER_DIALECT_FIROPS_H 10 #define OPTIMIZER_DIALECT_FIROPS_H 11 12 #include "mlir/Dialect/StandardOps/IR/Ops.h" 13 #include "mlir/Interfaces/LoopLikeInterface.h" 14 #include "mlir/Interfaces/SideEffectInterfaces.h" 15 16 using namespace mlir; 17 18 namespace fir { 19 20 class FirEndOp; 21 class LoopOp; 22 class RealAttr; 23 24 void buildCmpFOp(mlir::OpBuilder &builder, mlir::OperationState &result, 25 mlir::CmpFPredicate predicate, mlir::Value lhs, 26 mlir::Value rhs); 27 void buildCmpCOp(mlir::OpBuilder &builder, mlir::OperationState &result, 28 mlir::CmpFPredicate predicate, mlir::Value lhs, 29 mlir::Value rhs); 30 unsigned getCaseArgumentOffset(llvm::ArrayRef<mlir::Attribute> cases, 31 unsigned dest); 32 LoopOp getForInductionVarOwner(mlir::Value val); 33 bool isReferenceLike(mlir::Type type); 34 mlir::ParseResult isValidCaseAttr(mlir::Attribute attr); 35 mlir::ParseResult parseCmpfOp(mlir::OpAsmParser &parser, 36 mlir::OperationState &result); 37 mlir::ParseResult parseCmpcOp(mlir::OpAsmParser &parser, 38 mlir::OperationState &result); 39 mlir::ParseResult parseSelector(mlir::OpAsmParser &parser, 40 mlir::OperationState &result, 41 mlir::OpAsmParser::OperandType &selector, 42 mlir::Type &type); 43 44 } // namespace fir 45 46 #define GET_OP_CLASSES 47 #include "flang/Optimizer/Dialect/FIROps.h.inc" 48 49 50 #endif // OPTIMIZER_DIALECT_FIROPS_H 51