[Mlir-commits] [mlir] [MLIR][Arith][Resubmit] add fastMathAttr on arith::extf and arith::truncf (PR #95346)
Ivan Butygin
llvmlistbot at llvm.org
Thu Jun 13 06:53:21 PDT 2024
================
@@ -1390,6 +1390,23 @@ LogicalResult arith::ExtSIOp::verify() {
/// Fold extension of float constants when there is no information loss due the
/// difference in fp semantics.
OpFoldResult arith::ExtFOp::fold(FoldAdaptor adaptor) {
+ if (auto truncFOp = getOperand().getDefiningOp<TruncFOp>()) {
+ if (truncFOp.getOperand().getType() == getType()) {
+ arith::FastMathFlags truncFMF =
+ truncFOp.getFastmath().value_or(arith::FastMathFlags::none);
+ bool isTruncContract =
+ bitEnumContainsAll(truncFMF, arith::FastMathFlags::contract);
+ arith::FastMathFlags extFMF =
+ getFastmath().value_or(arith::FastMathFlags::none);
+ ;
----------------
Hardcode84 wrote:
nit: extra `;`
https://github.com/llvm/llvm-project/pull/95346
More information about the Mlir-commits
mailing list