diff options
| author | David Green <david.green@arm.com> | 2024-09-18 09:38:28 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-09-18 09:38:28 +0100 |
| commit | 112aac4e8961b9626bb84f36deeaa5a674f03f5a (patch) | |
| tree | 9f16f417df98f1bd91143a9acbc983d7be2be61f /lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp | |
| parent | d2d947b7e24679e0d1710a4f31dc0c8c9ee7c0b7 (diff) | |
[InstCombine] Fold fmod to frem if we know it does not set errno. (#107912)
fmod will be folded to frem in clang under -fno-math-errno and can be constant
folded in llvm if the operands are known. It can be relatively common to have
fp code that handles special values before doing some calculation:
```
if (isnan(f))
return handlenan;
if (isinf(f))
return handleinf;
..
fmod(f, 2.0)
```
This patch enables the folding of fmod to frem in instcombine if the first
parameter is not inf and the second is not zero. Other combinations do not set
errno.
The same transform is performed for fmod with the nnan flag, which implies the
input is known to not be inf/zero.
Diffstat (limited to 'lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp')
0 files changed, 0 insertions, 0 deletions
