Skip to content
Commit 0b8cb87e authored by Max Kudryavtsev's avatar Max Kudryavtsev Committed by Stella Stamenova
Browse files

[MLIR][STD] Add safe scalar constant propagation for FPTruncOp

Perform scalar constant propagation for FPTruncOp only if the resulting value can be represented without precision loss or rounding.

Example:
%cst = constant 1.000000e+00 : f32
%0 = fptrunc %cst : f32 to bf16
-->
%cst = constant 1.000000e+00 : bf16

Reviewed By: mehdi_amini

Differential Revision: https://reviews.llvm.org/D107518
parent 1854db74
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment