MLIR 22.0.0git
Utils.cpp
Go to the documentation of this file.
1//===- Utils.cpp - Utils for APFloat Conversion ---------------------------===//
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#include "Utils.h"
10
12#include "mlir/IR/Builders.h"
14#include "mlir/IR/Location.h"
15#include "mlir/IR/Value.h"
16
18 FloatType floatTy) {
19 int32_t sem = llvm::APFloatBase::SemanticsToEnum(floatTy.getFloatSemantics());
20 return arith::ConstantOp::create(b, loc, b.getI32Type(),
21 b.getIntegerAttr(b.getI32Type(), sem));
22}
b
Return true if permutation is a valid permutation of the outer_dims_perm (case OuterOrInnerPerm::Oute...
This class defines the main interface for locations in MLIR and acts as a non-nullable wrapper around...
Definition Location.h:76
This class helps build Operations.
Definition Builders.h:207
This class represents an instance of an SSA value in the MLIR system, representing a computable value...
Definition Value.h:96
Value getAPFloatSemanticsValue(OpBuilder &b, Location loc, FloatType floatTy)
Definition Utils.cpp:17