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 FORTRAN_OPTIMIZER_DIALECT_FIROPS_H
10 #define FORTRAN_OPTIMIZER_DIALECT_FIROPS_H
11 
12 #include "flang/Optimizer/Dialect/FIRType.h"
13 #include "mlir/Dialect/Arithmetic/IR/Arithmetic.h"
14 #include "mlir/Dialect/Func/IR/FuncOps.h"
15 #include "mlir/Interfaces/LoopLikeInterface.h"
16 #include "mlir/Interfaces/SideEffectInterfaces.h"
17 
18 namespace fir {
19 
20 class FirEndOp;
21 class DoLoopOp;
22 class RealAttr;
23 
24 void buildCmpCOp(mlir::OpBuilder &builder, mlir::OperationState &result,
25                  mlir::arith::CmpFPredicate predicate, mlir::Value lhs,
26                  mlir::Value rhs);
27 unsigned getCaseArgumentOffset(llvm::ArrayRef<mlir::Attribute> cases,
28                                unsigned dest);
29 DoLoopOp getForInductionVarOwner(mlir::Value val);
30 mlir::ParseResult isValidCaseAttr(mlir::Attribute attr);
31 mlir::ParseResult parseCmpcOp(mlir::OpAsmParser &parser,
32                               mlir::OperationState &result);
33 mlir::ParseResult parseSelector(mlir::OpAsmParser &parser,
34                                 mlir::OperationState &result,
35                                 mlir::OpAsmParser::UnresolvedOperand &selector,
36                                 mlir::Type &type);
37 
getAdaptToByRefAttrName()38 static constexpr llvm::StringRef getAdaptToByRefAttrName() {
39   return "adapt.valuebyref";
40 }
41 
getNormalizedLowerBoundAttrName()42 static constexpr llvm::StringRef getNormalizedLowerBoundAttrName() {
43   return "normalized.lb";
44 }
45 
46 } // namespace fir
47 
48 #define GET_OP_CLASSES
49 #include "flang/Optimizer/Dialect/FIROps.h.inc"
50 
51 #endif // FORTRAN_OPTIMIZER_DIALECT_FIROPS_H
52