Skip to content

Commit 70d8e4a

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

File tree

3 files changed

+2
-7
lines changed

3 files changed

+2
-7
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 & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -892,10 +892,6 @@ let
892892
@test fully_eliminated(ftest, Tuple{Bool})
893893
end
894894

895-
# sqrt not considered volatile
896-
f_sqrt() = sqrt(2)
897-
@test fully_eliminated(f_sqrt, Tuple{})
898-
899895
# use constant prop' result even when the return type doesn't get refined
900896
const Gx = Ref{Any}()
901897
Base.@constprop :aggressive function conditional_escape!(cnd, x)

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)