HomePhabricator

[ConstantFolding] Fold constrained arithmetic intrinsics

Authored by sepavloff on May 4 2021, 6:43 AM.

Description

[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

Details

Committed
sepavloffJul 23 2021, 12:39 AM
Differential Revision
D102673: [ConstantFolding] Fold constrained arithmetic intrinsics
Parents
rG2f15319968ec: [AMDGPU] Fix running ResourceUsageAnalysis
Branches
Unknown
Tags
Unknown