Commit Graph

4 Commits

Author SHA1 Message Date
Erik Eckstein
4d1df28de0 ConstantFolding: add constant folding for some floating point intrinsics
* `sitofp` signed integer to floating point
* `rint` round floating point to integral
* `bitcast` between integer and floating point

Constant folding `bitcast`s also made it necessary to rewrite constant folding for Nan and inf values, because the old code explicitly checked for `bitcast` intrinsics.
Relying on constant folded `bitcast`s makes the new version much simpler.

It is important to constant fold these intrinsics already in SIL because it enables other optimizations.
2025-04-01 18:13:01 +02:00
Alex Lorenz
0f9a69c712 android test fixes 2024-05-28 12:59:26 -07:00
Kshitij
993f7c3ed9 [Autodiff] Fixes breaking VJP and pullback inlining tests on Linux
The inlining benefit for VJPs and pullbacks seems to be a bit different on
macos and linux. This difference seems to be arising due to certain
function calls such as, `sin`, `cos` etc. always being inlined on macos
but not on linux.

Until I figure out a better way, I'm modifying these tests to avoid matching
the exact value of the inlining benefit, which causes them to fail on
Linux.
2024-05-21 16:05:17 -07:00
Kshitij
12faf79911 [Autodiff] Adds logic to rewrite call-sites using functions specialized by the closure-spec optimization 2024-05-21 12:02:28 -07:00