Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions base/compiler/optimize.jl
Original file line number Diff line number Diff line change
Expand Up @@ -621,6 +621,7 @@ function is_pure_intrinsic_infer(f::IntrinsicFunction)
f === Intrinsics.pointerset || # this one is never effect-free
f === Intrinsics.llvmcall || # this one is never effect-free
f === Intrinsics.arraylen || # this one is volatile
f === Intrinsics.sqrt_llvm || # this one may differ at runtime (by a few ulps)
f === Intrinsics.sqrt_llvm_fast || # this one may differ at runtime (by a few ulps)
f === Intrinsics.have_fma || # this one depends on the runtime environment
f === Intrinsics.cglobal) # cglobal lookup answer changes at runtime
Expand Down
4 changes: 0 additions & 4 deletions test/compiler/inline.jl
Original file line number Diff line number Diff line change
Expand Up @@ -892,10 +892,6 @@ let
@test fully_eliminated(ftest, Tuple{Bool})
end

# sqrt not considered volatile
f_sqrt() = sqrt(2)
@test fully_eliminated(f_sqrt, Tuple{})

# use constant prop' result even when the return type doesn't get refined
const Gx = Ref{Any}()
Base.@constprop :aggressive function conditional_escape!(cnd, x)
Expand Down
8 changes: 3 additions & 5 deletions test/math.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1385,12 +1385,10 @@ end
for (x,y) in testdata
# Runtime version
@test sqrt(x) === y
# Interpreter compile-time version
@test Base.invokelatest((@eval ()->sqrt(Base.inferencebarrier($x)))) == y
# Inference const-prop version
@test Base.invokelatest((@eval ()->sqrt($x))) == y
# Interpreter compile-time version - currently broken on linux32
#@test Base.invokelatest((@eval ()->sqrt($x))) == y
# LLVM constant folding version
@test Base.invokelatest((@eval ()->(@force_compile; sqrt(Base.inferencebarrier($x))))) == y
@test Base.invokelatest((@eval ()->(@force_compile; sqrt($x)))) == y
end
end

Expand Down