Teach julia that `NaNMath` functions don't have effects
This allows constant folding and dead code elimination on Julia 1.8 and up.
Codecov Report
Patch coverage: 80.00% and project coverage change: +0.02% :tada:
Comparison is base (
d5ea765) 97.05% compared to head (d51c509) 97.08%.
Additional details and impacted files
@@ Coverage Diff @@
## master #67 +/- ##
==========================================
+ Coverage 97.05% 97.08% +0.02%
==========================================
Files 1 1
Lines 102 103 +1
==========================================
+ Hits 99 100 +1
Misses 3 3
| Files Changed | Coverage Δ | |
|---|---|---|
| src/NaNMath.jl | 97.08% <80.00%> (+0.02%) |
:arrow_up: |
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
I'm not the right person to review this.
This needs a review from someone who understands @assume_effects
I've talked to @vtjnash about this a bit and he thinks that libm might be leaking effectful information (rounding modes and signals) but I haven't been able to find observe this.
In particular, note that C documentation for these explicitly states these are not pure due to side effects.
however the two areas of impurity (rounding modes and flags) appear not to be accessible from julia (or at least I haven't been able to observe the impurity)