|
MLIR 22.0.0git
|
#include "Utils.h"#include "mlir/Conversion/ArithAndMathToAPFloat/ArithToAPFloat.h"#include "mlir/Dialect/Arith/IR/Arith.h"#include "mlir/Dialect/Arith/Transforms/Passes.h"#include "mlir/Dialect/Func/IR/FuncOps.h"#include "mlir/Dialect/Func/Utils/Utils.h"#include "mlir/Dialect/Vector/IR/VectorOps.h"#include "mlir/IR/PatternMatch.h"#include "mlir/IR/Verifier.h"#include "mlir/Transforms/WalkPatternRewriteDriver.h"#include "mlir/Conversion/Passes.h.inc"Go to the source code of this file.
Classes | |
| struct | BinaryArithOpToAPFloatConversion< OpTy > |
| Rewrite a binary arithmetic operation to an APFloat function call. More... | |
| struct | FpToFpConversion< OpTy > |
| struct | FpToIntConversion< OpTy > |
| struct | IntToFpConversion< OpTy > |
| struct | CmpFOpToAPFloatConversion |
| struct | NegFOpToAPFloatConversion |
Namespaces | |
| namespace | mlir |
| Include the generated interface declarations. | |
Macros | |
| #define | GEN_PASS_DEF_ARITHTOAPFLOATCONVERSIONPASS |
Functions | |
| static FailureOr< FuncOp > | lookupOrCreateBinaryFn (OpBuilder &b, SymbolOpInterface symTable, StringRef name, SymbolTableCollection *symbolTables=nullptr) |
| Helper function to look up or create the symbol for a runtime library function for a binary arithmetic operation. | |
| template<typename Fn, typename... Values> | |
| static Value | forEachScalarValue (RewriterBase &rewriter, Location loc, Value operand1, Value operand2, Type resultType, Fn fn) |
| Given two operands of vector type and vector result type (with the same shape), call the given function for each pair of scalar operands and package the result into a vector. | |
| static LogicalResult | checkPreconditions (RewriterBase &rewriter, Operation *op) |
| Check preconditions for the conversion: | |
| #define GEN_PASS_DEF_ARITHTOAPFLOATCONVERSIONPASS |
Definition at line 22 of file ArithToAPFloat.cpp.
|
static |
Check preconditions for the conversion:
Definition at line 99 of file ArithToAPFloat.cpp.
References mlir::Type::getIntOrFloatBitWidth(), mlir::Operation::getOperands(), mlir::Operation::getResults(), mlir::Type::isIntOrFloat(), mlir::RewriterBase::notifyMatchFailure(), and success().
Referenced by BinaryArithOpToAPFloatConversion< OpTy >::matchAndRewrite(), CmpFOpToAPFloatConversion::matchAndRewrite(), FpToFpConversion< OpTy >::matchAndRewrite(), FpToIntConversion< OpTy >::matchAndRewrite(), IntToFpConversion< OpTy >::matchAndRewrite(), and NegFOpToAPFloatConversion::matchAndRewrite().
|
static |
Given two operands of vector type and vector result type (with the same shape), call the given function for each pair of scalar operands and package the result into a vector.
If the given operands and result type are not vectors, call the function directly. The second operand is optional.
Definition at line 54 of file ArithToAPFloat.cpp.
References mlir::Value::getType(), and result.
Referenced by BinaryArithOpToAPFloatConversion< OpTy >::matchAndRewrite(), CmpFOpToAPFloatConversion::matchAndRewrite(), FpToFpConversion< OpTy >::matchAndRewrite(), FpToIntConversion< OpTy >::matchAndRewrite(), IntToFpConversion< OpTy >::matchAndRewrite(), and NegFOpToAPFloatConversion::matchAndRewrite().
|
static |
Helper function to look up or create the symbol for a runtime library function for a binary arithmetic operation.
Parameter 1: APFloat semantics Parameter 2: Left-hand side operand Parameter 3: Right-hand side operand
This function will return a failure if the function is found but has an unexpected signature.
Definition at line 40 of file ArithToAPFloat.cpp.
References b, and mlir::func::lookupOrCreateFnDecl().
Referenced by BinaryArithOpToAPFloatConversion< OpTy >::matchAndRewrite().