[ConstantFolding] Fold constrained arithmetic intrinsics
Constfold constrained variants of operations fadd, fsub, fmul, fdiv, frem, fma and fmuladd. The change also sets up some means to support for removal of unused constrained intrinsics. They are declared as accessing memory to model interaction with floating point environment, so they were not removed, as they have side effect. Now constrained intrinsics that have "fpexcept.ignore" as exception behavior are removed if they have no uses. As for intrinsics that have exception behavior other than "fpexcept.ignore", they can be removed if it is known that they do not raise floating point exceptions. It happens when doing constant folding, attributes of such intrinsic are changed so that the intrinsic is not claimed as accessing memory. Differential Revision: https://reviews.llvm.org/D102673
Loading
Please sign in to comment