Skip to content

Commit b07cd82

Browse files
committed
remove now unnecessary effects annotations
1 parent 9225ae0 commit b07cd82

File tree

4 files changed

+7
-18
lines changed

4 files changed

+7
-18
lines changed

base/math.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ end
307307
Base.@assume_effects :terminates_locally @inline function exthorner(x, p::Tuple)
308308
hi, lo = p[end], zero(x)
309309
for i in length(p)-1:-1:1
310-
pi = getfield(p, i) # needed to prove consistency
310+
pi = @inbounds p[i]
311311
prod, err = two_mul(hi,x)
312312
hi = pi+prod
313313
lo = fma(lo, x, prod - (hi - pi) + err)

base/special/exp.jl

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -174,10 +174,9 @@ const J_TABLE = (0x0000000000000000, 0xaac00b1afa5abcbe, 0x9b60163da9fb3335, 0xa
174174
0xa66f0f9c1cb64129, 0x93af252b376bba97, 0xacdf3ac948dd7273, 0x99df50765b6e4540, 0x9faf6632798844f8,
175175
0xa12f7bfdad9cbe13, 0xaeef91d802243c88, 0x874fa7c1819e90d8, 0xacdfbdba3692d513, 0x62efd3c22b8f71f1, 0x74afe9d96b2a23d9)
176176

177-
# :nothrow needed since the compiler can't prove `ind` is inbounds.
178-
Base.@assume_effects :nothrow function table_unpack(ind::Int32)
177+
function table_unpack(ind::Int32)
179178
ind = ind & 255 + 1 # 255 == length(J_TABLE) - 1
180-
j = getfield(J_TABLE, ind) # use getfield so the compiler can prove consistent
179+
j = @inbounds J_TABLE[ind]
181180
jU = reinterpret(Float64, JU_CONST | (j&JU_MASK))
182181
jL = reinterpret(Float64, JL_CONST | (j>>8))
183182
return jU, jL

base/special/log.jl

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -155,10 +155,7 @@ logbU(::Type{Float64},::Val{10}) = 0.4342944819032518
155155
logbL(::Type{Float64},::Val{10}) = 1.098319650216765e-17
156156

157157
# Procedure 1
158-
# XXX we want to mark :consistent-cy here so that this function can be concrete-folded,
159-
# because the effect analysis currently can't prove it in the presence of `@inbounds` or
160-
# `:boundscheck`, but still the access to `t_log_Float64` is really safe here
161-
Base.@assume_effects :consistent @inline function log_proc1(y::Float64,mf::Float64,F::Float64,f::Float64,base=Val(:ℯ))
158+
@inline function log_proc1(y::Float64,mf::Float64,F::Float64,f::Float64,base=Val(:ℯ))
162159
jp = unsafe_trunc(Int,128.0*F)-127
163160

164161
## Steps 1 and 2
@@ -216,10 +213,7 @@ end
216213
end
217214

218215
# Procedure 1
219-
# XXX we want to mark :consistent-cy here so that this function can be concrete-folded,
220-
# because the effect analysis currently can't prove it in the presence of `@inbounds` or
221-
# `:boundscheck`, but still the access to `t_log_Float32` is really safe here
222-
Base.@assume_effects :consistent @inline function log_proc1(y::Float32,mf::Float32,F::Float32,f::Float32,base=Val(:ℯ))
216+
@inline function log_proc1(y::Float32,mf::Float32,F::Float32,f::Float32,base=Val(:ℯ))
223217
jp = unsafe_trunc(Int,128.0f0*F)-127
224218

225219
## Steps 1 and 2
@@ -571,8 +565,7 @@ function _log_ext(xu)
571565
z = reinterpret(Float64, xu - (tmp & 0xfff0000000000000))
572566
k = Float64(tmp >> 52)
573567
# log(x) = k*Ln2 + log(c) + log1p(z/c-1).
574-
# getfield instead of getindex to satisfy effect analysis not knowing whether this is inbounds
575-
t, logctail = getfield(t_log_table_compact, Int(i+1))
568+
t, logctail = @inbounds t_log_table_compact[Int(i+1)]
576569
invc, logc = log_tab_unpack(t)
577570
# Note: invc is j/N or j/N/2 where j is an integer in [N,2N) and
578571
# |z/c - 1| < 1/N, so r = z/c - 1 is exactly representable.

base/special/rem_pio2.jl

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -126,10 +126,7 @@ function fromfraction(f::Int128)
126126
return (z1,z2)
127127
end
128128

129-
# XXX we want to mark :consistent-cy here so that this function can be concrete-folded,
130-
# because the effect analysis currently can't prove it in the presence of `@inbounds` or
131-
# `:boundscheck`, but still the accesses to `INV_2PI` are really safe here
132-
Base.@assume_effects :consistent function paynehanek(x::Float64)
129+
function paynehanek(x::Float64)
133130
# 1. Convert to form
134131
#
135132
# x = X * 2^k,

0 commit comments

Comments
 (0)