Skip to content

Commit e52d912

Browse files
committed
Revert "Remove sqrt from the volatile list (#43786)"
This reverts commit cc96240.
1 parent bd9c510 commit e52d912

File tree

3 files changed

+2
-8
lines changed

3 files changed

+2
-8
lines changed

base/compiler/optimize.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -621,6 +621,7 @@ function is_pure_intrinsic_infer(f::IntrinsicFunction)
621621
f === Intrinsics.pointerset || # this one is never effect-free
622622
f === Intrinsics.llvmcall || # this one is never effect-free
623623
f === Intrinsics.arraylen || # this one is volatile
624+
f === Intrinsics.sqrt_llvm || # this one may differ at runtime (by a few ulps)
624625
f === Intrinsics.sqrt_llvm_fast || # this one may differ at runtime (by a few ulps)
625626
f === Intrinsics.have_fma || # this one depends on the runtime environment
626627
f === Intrinsics.cglobal) # cglobal lookup answer changes at runtime

test/compiler/inline.jl

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -890,11 +890,6 @@ let
890890
@noinline fcond(a, b) = a === b
891891
ftest(a) = (fcond(a, nothing); a)
892892
@test fully_eliminated(ftest, Tuple{Bool})
893-
end
894-
895-
# sqrt not considered volatile
896-
f_sqrt() = sqrt(2)
897-
@test fully_eliminated(f_sqrt, Tuple{})
898893

899894
# use constant prop' result even when the return type doesn't get refined
900895
const Gx = Ref{Any}()

test/math.jl

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1386,11 +1386,9 @@ end
13861386
# Runtime version
13871387
@test sqrt(x) === y
13881388
# Interpreter compile-time version
1389-
@test Base.invokelatest((@eval ()->sqrt(Base.inferencebarrier($x)))) == y
1390-
# Inference const-prop version
13911389
@test Base.invokelatest((@eval ()->sqrt($x))) == y
13921390
# LLVM constant folding version
1393-
@test Base.invokelatest((@eval ()->(@force_compile; sqrt(Base.inferencebarrier($x))))) == y
1391+
@test Base.invokelatest((@eval ()->(@force_compile; sqrt($x)))) == y
13941392
end
13951393
end
13961394

0 commit comments

Comments
 (0)