Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backports release 1.11 #55344

Merged
merged 59 commits into from
Aug 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
50e5fe0
Add timing to precompile trace compile (#54962)
IanButterworth Jul 1, 2024
29f6950
Fix annotated join with non-concrete eltype iters (#54919)
tecosaur Jul 24, 2024
0429e1e
[docs] change docstring to match code (#55013)
araujoms Jul 25, 2024
1f285ec
TOML: Make `Dates` a type parameter (#55017)
topolarity Jul 25, 2024
70af74e
Fix a bug in `stack`'s DimensionMismatch error message (#54033)
mcabbott Jul 25, 2024
bab4ef1
fix at-main docstring to not code quote a compat box (#55242)
KristofferC Jul 25, 2024
e7ddd62
Make `jl_*affinity` tests more portable (#55261)
ararslan Jul 27, 2024
e0b2828
specificity: ensure fast-path in `sub/eq_msp` handle missing `UnionAl…
N5N3 Jul 29, 2024
4381c05
typeintersect: fix bounds merging during inner `intersect_all` (#55299)
N5N3 Jul 30, 2024
b010b97
Add `lbt_forwarded_funcs()` to debug LBT forwarding issues (#55302)
staticfloat Jul 30, 2024
aacb1ca
Random: Mark unexported public symbols as public (#55148)
jakobnissen Jul 30, 2024
b0691b5
avoid overflowing show for OffsetArrays around typemax (#55303)
mbauman Jul 31, 2024
2b31eab
Restrict argument to `isleapyear(::Integer)` (#55317)
jariji Jul 31, 2024
78ed775
Profile: Fix stdlib paths (#55327)
IanButterworth Aug 1, 2024
6a5792d
[libblastrampoline] Bump to v5.11.0 (#55330)
staticfloat Aug 1, 2024
5431961
Preserve structure in scaling triangular matrices by NaN (#55310)
jishnub Aug 1, 2024
eaa792f
Add PGO/LTO Makefile to NEWS.md
giordano Aug 2, 2024
2f46f2b
🤖 [backports-release-1.11] Bump the Pkg stdlib from 8457d3eff to 2ff6…
DilumAluthgeBot Aug 5, 2024
46ed1ba
[build] Some improvements to the LLVM build system (#55354)
giordano Aug 6, 2024
cb7a962
Profile: close files when assembling heap snapshot (#55356)
topolarity Aug 3, 2024
8a4dd86
Fix tr for block SymTridiagonal (#55371)
jishnub Aug 5, 2024
885aeda
Make REPL.TerminalMenus and some if its symbols public (#55307)
GHTaarn Aug 5, 2024
9386218
inference: fix missing LimitedAccuracy markers (#55362)
vtjnash Aug 5, 2024
c802049
AllocOpt: Fix stack lowering where alloca continas boxed and unboxed …
wsmoses Aug 6, 2024
fbcb434
fix #55389: type-unstable `join` (#55395)
simeonschaub Aug 6, 2024
894454c
re-add `unsafe_convert` for Reinterpret and Reshaped array (#55226)
oscardssmith Aug 8, 2024
b7d4aeb
compiler: apply more accurate effects to return_type_tfunc (#55338)
vtjnash Aug 10, 2024
b29b9b5
handle unbound vars in NTuple fields (#55405)
vtjnash Aug 8, 2024
cc694e4
ml-matches: ensure all methods are included (#55365)
vtjnash Aug 8, 2024
d499694
codegen: move undef freeze before promotion point (#55428)
vtjnash Aug 9, 2024
99583cf
`stale_cachefile`: handle if the expected cache file is missing (#55419)
IanButterworth Aug 9, 2024
10b55db
Add push! implementation for AbstractArray depending only on resize! …
mkitti Aug 12, 2024
709d83e
fix hierarchy level of "API reference" in `Dates` documentation (#55483)
matthias314 Aug 13, 2024
403558e
fix a test that does not apply to 1.11 according to Jameson
Aug 14, 2024
86a5aee
simplify complex atanh and remove singularity perturbation (#55268)
oscardssmith Aug 13, 2024
133b83a
Backport https://github.com/JuliaLang/julia/pull/55407 to 1.11 (#55433)
gbaraldi Aug 14, 2024
bcb33ed
[release-1.11] fix GC race bug in pool sweep (#55485)
d-netto Aug 14, 2024
16a7ad9
compress jit debuginfo for easy memory savings (#55180)
vtjnash Jul 23, 2024
89faa35
mapreduce: don't inbounds unknown functions (#55329)
mbauman Aug 2, 2024
63c8445
fix Event to use normal Condition variable (#55441)
vtjnash Aug 14, 2024
b1e0fc4
subtyping: fast path for lhs union and rhs typevar (#55413)
vtjnash Aug 14, 2024
95e255f
build: add missing dependencies for expmap (#55492)
vtjnash Aug 15, 2024
876853b
Fix fast getptls ccall lowering. (#55507)
gbaraldi Aug 16, 2024
7a3e21f
Update symmetric docstring to reflect the type of uplo (#55504)
jishnub Aug 17, 2024
c9d09d6
Ensure bidiagonal setindex! does not read indices in error message (#…
jishnub Aug 3, 2024
07df4bb
Do not load `ScopedValues` with `using` (#55452)
LilithHafner Aug 15, 2024
0ccd4ed
add missing clamp function for IOBuffer (#55424)
KristofferC Aug 9, 2024
00b6831
Vendor the terminfo database for use with base/terminfo.jl (#55411)
ararslan Aug 8, 2024
28fcbff
codgen: make the Memory GEP an inbounds GEP (#55107)
gbaraldi Aug 8, 2024
4e7648f
Backport "Fix (l/r)mul! with Diagonal/Bidiagonal #55052" to v1.11 (#5…
jishnub Aug 19, 2024
44fc535
Restrict binary ops for Diagonal and Symmetric to Number eltypes (#55…
jishnub Jul 28, 2024
b09a4b3
Make `Base.depwarn()` public (#55212)
JamesWrigley Jul 25, 2024
8da6a94
LAPACK: Aggressive constprop to concretely infer syev!/syevd! (#55295)
jishnub Jul 30, 2024
8c60a17
🤖 [master] Bump the StyledStrings stdlib from d7496d2 to f6035eb (#55…
DilumAluthgeBot Aug 12, 2024
9723ff1
atomics: fix setonce runtime intrinsic
vtjnash Aug 19, 2024
7b18f9c
codegen: NFC refactoring to use Align type
vtjnash Aug 3, 2024
e964634
codegen: update type of x after type-assert
vtjnash Aug 3, 2024
8467772
codegen: take gc roots (and alloca alignment) more seriously
vtjnash Aug 1, 2024
13d440d
Backport "Fix tr for Symmetric/Hermitian block matrices #55522" to v1…
jishnub Aug 21, 2024
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
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -398,6 +398,10 @@ endif
# Install appdata file
mkdir -p $(DESTDIR)$(datarootdir)/appdata/
$(INSTALL_F) $(JULIAHOME)/contrib/julia.appdata.xml $(DESTDIR)$(datarootdir)/appdata/
# Install terminal info database
ifneq ($(WITH_TERMINFO),0)
cp -R -L $(build_datarootdir)/terminfo $(DESTDIR)$(datarootdir)
endif

# Update RPATH entries and JL_SYSTEM_IMAGE_PATH if $(private_libdir_rel) != $(build_private_libdir_rel)
ifneq ($(private_libdir_rel),$(build_private_libdir_rel))
Expand Down
9 changes: 9 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,11 @@ Multi-threading changes
* `Threads.@threads` now supports the `:greedy` scheduler, intended for non-uniform workloads ([#52096]).
* A new public (but unexported) struct `Base.Lockable{T, L<:AbstractLock}` makes it easy to bundle a resource and its lock together ([#52898]).

Build system changes
--------------------

* There is a new `Makefile` to build Julia and LLVM using the profile-guided and link-time optimizations (PGO and LTO) strategies, see `contrib/pgo-lto/Makefile` ([#45641]).

New library functions
---------------------

Expand Down Expand Up @@ -202,6 +207,9 @@ External dependencies

* The libuv library has been updated from a base of v1.44.2 to v1.48.0 ([#49937]).
* `tput` is no longer called to check terminal capabilities; it has been replaced with a pure-Julia terminfo parser ([#50797]).
- The terminal info database, `terminfo`, is now vendored by default, providing a better
REPL user experience when `terminfo` is not available on the system. Julia can be built
without vendoring the database using the Makefile option `WITH_TERMINFO=0`. ([#55411])

Tooling Improvements
--------------------
Expand All @@ -220,6 +228,7 @@ Tooling Improvements
[#42593]: https://github.com/JuliaLang/julia/issues/42593
[#43845]: https://github.com/JuliaLang/julia/issues/43845
[#45156]: https://github.com/JuliaLang/julia/issues/45156
[#45641]: https://github.com/JuliaLang/julia/issues/45641
[#46501]: https://github.com/JuliaLang/julia/issues/46501
[#47354]: https://github.com/JuliaLang/julia/issues/47354
[#47679]: https://github.com/JuliaLang/julia/issues/47679
Expand Down
1 change: 0 additions & 1 deletion base/Base.jl
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,6 @@ include("weakkeydict.jl")

# ScopedValues
include("scopedvalues.jl")
using .ScopedValues

# metaprogramming
include("meta.jl")
Expand Down
34 changes: 33 additions & 1 deletion base/abstractarray.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2985,7 +2985,7 @@ end
@inline function _stack_size_check(x, ax1::Tuple)
if _iterator_axes(x) != ax1
uax1 = map(UnitRange, ax1)
uaxN = map(UnitRange, axes(x))
uaxN = map(UnitRange, _iterator_axes(x))
throw(DimensionMismatch(
LazyString("stack expects uniform slices, got axes(x) == ", uaxN, " while first had ", uax1)))
end
Expand Down Expand Up @@ -3497,13 +3497,45 @@ julia> map(+, [1 2; 3 4], [1,10,100,1000], zeros(3,1)) # iterates until 3rd is
"""
map(f, it, iters...) = collect(Generator(f, it, iters...))

# Generic versions of push! for AbstractVector
# These are specialized further for Vector for faster resizing and setindexing
function push!(a::AbstractVector{T}, item) where T
# convert first so we don't grow the array if the assignment won't work
itemT = item isa T ? item : convert(T, item)::T
new_length = length(a) + 1
resize!(a, new_length)
a[new_length] = itemT
return a
end

# specialize and optimize the single argument case
function push!(a::AbstractVector{Any}, @nospecialize x)
new_length = length(a) + 1
resize!(a, new_length)
a[new_length] = x
return a
end
function push!(a::AbstractVector{Any}, @nospecialize x...)
@_terminates_locally_meta
na = length(a)
nx = length(x)
resize!(a, na + nx)
for i = 1:nx
a[na+i] = x[i]
end
return a
end

# multi-item push!, pushfirst! (built on top of type-specific 1-item version)
# (note: must not cause a dispatch loop when 1-item case is not defined)
push!(A, a, b) = push!(push!(A, a), b)
push!(A, a, b, c...) = push!(push!(A, a, b), c...)
pushfirst!(A, a, b) = pushfirst!(pushfirst!(A, b), a)
pushfirst!(A, a, b, c...) = pushfirst!(pushfirst!(A, c...), a, b)

# sizehint! does not nothing by default
sizehint!(a::AbstractVector, _) = a

## hashing AbstractArray ##

const hash_abstractarray_seed = UInt === UInt64 ? 0x7e2d6fb6448beb77 : 0xd4514ce5
Expand Down
3 changes: 2 additions & 1 deletion base/boot.jl
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,8 @@ macro _foldable_meta()
#=:inaccessiblememonly=#true,
#=:noub=#true,
#=:noub_if_noinbounds=#false,
#=:consistent_overlay=#false))
#=:consistent_overlay=#false,
#=:nortcall=#true))
end

macro inline() Expr(:meta, :inline) end
Expand Down
2 changes: 1 addition & 1 deletion base/client.jl
Original file line number Diff line number Diff line change
Expand Up @@ -608,10 +608,10 @@ module MyApp
end
const main = MyApp.main
# `julia` Will *NOT* execute MyApp.main unless there is a separate `@main` annotation in `Main`
```

!!! compat "Julia 1.11"
This macro is new in Julia 1.11. At present, the precise semantics of `@main` are still subject to change.
```
"""
macro main(args...)
if !isempty(args)
Expand Down
2 changes: 1 addition & 1 deletion base/cmd.jl
Original file line number Diff line number Diff line change
Expand Up @@ -482,7 +482,7 @@ function cmd_gen(parsed)
end
end

@assume_effects :effect_free :terminates_globally :noub function cmd_gen(
@assume_effects :foldable !:consistent function cmd_gen(
parsed::Tuple{Vararg{Tuple{Vararg{Union{String, SubString{String}}}}}}
)
return @invoke cmd_gen(parsed::Any)
Expand Down
27 changes: 19 additions & 8 deletions base/compiler/abstractinterpretation.jl
Original file line number Diff line number Diff line change
Expand Up @@ -605,13 +605,23 @@ function abstract_call_method(interp::AbstractInterpreter,
end
add_remark!(interp, sv, washardlimit ? RECURSION_MSG_HARDLIMIT : RECURSION_MSG)
# TODO (#48913) implement a proper recursion handling for irinterp:
# This works just because currently the `:terminate` condition guarantees that
# irinterp doesn't fail into unresolved cycles, but it's not a good solution.
# This works just because currently the `:terminate` condition usually means this is unreachable here
# for irinterp because there are not unresolved cycles, but it's not a good solution.
# We should revisit this once we have a better story for handling cycles in irinterp.
if isa(topmost, InferenceState)
if isa(sv, InferenceState)
# since the hardlimit is against the edge to the parent frame,
# we should try to poison the whole edge, not just the topmost frame
parentframe = frame_parent(topmost)
if isa(sv, InferenceState) && isa(parentframe, InferenceState)
poison_callstack!(sv, parentframe === nothing ? topmost : parentframe)
while !isa(parentframe, InferenceState)
# attempt to find a parent frame that can handle this LimitedAccuracy result correctly
# so we don't try to cache this incomplete intermediate result
parentframe === nothing && break
parentframe = frame_parent(parentframe)
end
if isa(parentframe, InferenceState)
poison_callstack!(sv, parentframe)
elseif isa(topmost, InferenceState)
poison_callstack!(sv, topmost)
end
end
# n.b. this heuristic depends on the non-local state, so we must record the limit later
Expand Down Expand Up @@ -887,7 +897,7 @@ function concrete_eval_eligible(interp::AbstractInterpreter,
end
end
mi = result.edge
if mi !== nothing && is_foldable(effects)
if mi !== nothing && is_foldable(effects, #=check_rtcall=#true)
if f !== nothing && is_all_const_arg(arginfo, #=start=#2)
if (is_nonoverlayed(interp) || is_nonoverlayed(effects) ||
# Even if overlay methods are involved, when `:consistent_overlay` is
Expand Down Expand Up @@ -2778,8 +2788,9 @@ function override_effects(effects::Effects, override::EffectsOverride)
notaskstate = override.notaskstate ? true : effects.notaskstate,
inaccessiblememonly = override.inaccessiblememonly ? ALWAYS_TRUE : effects.inaccessiblememonly,
noub = override.noub ? ALWAYS_TRUE :
(override.noub_if_noinbounds && effects.noub !== ALWAYS_TRUE) ? NOUB_IF_NOINBOUNDS :
effects.noub)
(override.noub_if_noinbounds && effects.noub !== ALWAYS_TRUE) ? NOUB_IF_NOINBOUNDS :
effects.noub,
nortcall = override.nortcall ? true : effects.nortcall)
end

isdefined_globalref(g::GlobalRef) = !iszero(ccall(:jl_globalref_boundp, Cint, (Any,), g))
Expand Down
11 changes: 7 additions & 4 deletions base/compiler/compiler.jl
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,11 @@ struct EffectsOverride
noub::Bool
noub_if_noinbounds::Bool
consistent_overlay::Bool
nortcall::Bool
end
function EffectsOverride(
override::EffectsOverride =
EffectsOverride(false, false, false, false, false, false, false, false, false, false);
EffectsOverride(false, false, false, false, false, false, false, false, false, false, false);
consistent::Bool = override.consistent,
effect_free::Bool = override.effect_free,
nothrow::Bool = override.nothrow,
Expand All @@ -61,7 +62,8 @@ function EffectsOverride(
inaccessiblememonly::Bool = override.inaccessiblememonly,
noub::Bool = override.noub,
noub_if_noinbounds::Bool = override.noub_if_noinbounds,
consistent_overlay::Bool = override.consistent_overlay)
consistent_overlay::Bool = override.consistent_overlay,
nortcall::Bool = override.nortcall)
return EffectsOverride(
consistent,
effect_free,
Expand All @@ -72,9 +74,10 @@ function EffectsOverride(
inaccessiblememonly,
noub,
noub_if_noinbounds,
consistent_overlay)
consistent_overlay,
nortcall)
end
const NUM_EFFECTS_OVERRIDES = 10 # sync with julia.h
const NUM_EFFECTS_OVERRIDES = 11 # sync with julia.h

# essential files and libraries
include("essentials.jl")
Expand Down
55 changes: 39 additions & 16 deletions base/compiler/effects.jl
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ following meanings:
methods are `:consistent` with their non-overlayed original counterparts
(see [`Base.@assume_effects`](@ref) for the exact definition of `:consistenct`-cy).
* `ALWAYS_FALSE`: this method may invoke overlayed methods.
- `nortcall::Bool`: this method does not call `Core.Compiler.return_type`,
and it is guaranteed that any other methods this method might call also do not call
`Core.Compiler.return_type`.

Note that the representations above are just internal implementation details and thus likely
to change in the future. See [`Base.@assume_effects`](@ref) for more detailed explanation
Expand Down Expand Up @@ -103,6 +106,9 @@ The output represents the state of different effect properties in the following
- `+o` (green): `ALWAYS_TRUE`
- `-o` (red): `ALWAYS_FALSE`
- `?o` (yellow): `CONSISTENT_OVERLAY`
9. `:nortcall` (`r`):
- `+r` (green): `true`
- `-r` (red): `false`
"""
struct Effects
consistent::UInt8
Expand All @@ -113,6 +119,7 @@ struct Effects
inaccessiblememonly::UInt8
noub::UInt8
nonoverlayed::UInt8
nortcall::Bool
function Effects(
consistent::UInt8,
effect_free::UInt8,
Expand All @@ -121,7 +128,8 @@ struct Effects
notaskstate::Bool,
inaccessiblememonly::UInt8,
noub::UInt8,
nonoverlayed::UInt8)
nonoverlayed::UInt8,
nortcall::Bool)
return new(
consistent,
effect_free,
Expand All @@ -130,7 +138,8 @@ struct Effects
notaskstate,
inaccessiblememonly,
noub,
nonoverlayed)
nonoverlayed,
nortcall)
end
end

Expand Down Expand Up @@ -160,10 +169,10 @@ const NOUB_IF_NOINBOUNDS = 0x01 << 1
# :nonoverlayed bits
const CONSISTENT_OVERLAY = 0x01 << 1

const EFFECTS_TOTAL = Effects(ALWAYS_TRUE, ALWAYS_TRUE, true, true, true, ALWAYS_TRUE, ALWAYS_TRUE, ALWAYS_TRUE)
const EFFECTS_THROWS = Effects(ALWAYS_TRUE, ALWAYS_TRUE, false, true, true, ALWAYS_TRUE, ALWAYS_TRUE, ALWAYS_TRUE)
const EFFECTS_UNKNOWN = Effects(ALWAYS_FALSE, ALWAYS_FALSE, false, false, false, ALWAYS_FALSE, ALWAYS_FALSE, ALWAYS_TRUE) # unknown mostly, but it's not overlayed at least (e.g. it's not a call)
const _EFFECTS_UNKNOWN = Effects(ALWAYS_FALSE, ALWAYS_FALSE, false, false, false, ALWAYS_FALSE, ALWAYS_FALSE, ALWAYS_FALSE) # unknown really
const EFFECTS_TOTAL = Effects(ALWAYS_TRUE, ALWAYS_TRUE, true, true, true, ALWAYS_TRUE, ALWAYS_TRUE, ALWAYS_TRUE, true)
const EFFECTS_THROWS = Effects(ALWAYS_TRUE, ALWAYS_TRUE, false, true, true, ALWAYS_TRUE, ALWAYS_TRUE, ALWAYS_TRUE, true)
const EFFECTS_UNKNOWN = Effects(ALWAYS_FALSE, ALWAYS_FALSE, false, false, false, ALWAYS_FALSE, ALWAYS_FALSE, ALWAYS_TRUE, false) # unknown mostly, but it's not overlayed at least (e.g. it's not a call)
const _EFFECTS_UNKNOWN = Effects(ALWAYS_FALSE, ALWAYS_FALSE, false, false, false, ALWAYS_FALSE, ALWAYS_FALSE, ALWAYS_FALSE, false) # unknown really

function Effects(effects::Effects = _EFFECTS_UNKNOWN;
consistent::UInt8 = effects.consistent,
Expand All @@ -173,7 +182,8 @@ function Effects(effects::Effects = _EFFECTS_UNKNOWN;
notaskstate::Bool = effects.notaskstate,
inaccessiblememonly::UInt8 = effects.inaccessiblememonly,
noub::UInt8 = effects.noub,
nonoverlayed::UInt8 = effects.nonoverlayed)
nonoverlayed::UInt8 = effects.nonoverlayed,
nortcall::Bool = effects.nortcall)
return Effects(
consistent,
effect_free,
Expand All @@ -182,7 +192,8 @@ function Effects(effects::Effects = _EFFECTS_UNKNOWN;
notaskstate,
inaccessiblememonly,
noub,
nonoverlayed)
nonoverlayed,
nortcall)
end

function is_better_effects(new::Effects, old::Effects)
Expand Down Expand Up @@ -247,6 +258,11 @@ function is_better_effects(new::Effects, old::Effects)
elseif new.nonoverlayed != old.nonoverlayed
return false
end
if new.nortcall
any_improved |= !old.nortcall
elseif new.nortcall != old.nortcall
return false
end
return any_improved
end

Expand All @@ -259,7 +275,8 @@ function merge_effects(old::Effects, new::Effects)
merge_effectbits(old.notaskstate, new.notaskstate),
merge_effectbits(old.inaccessiblememonly, new.inaccessiblememonly),
merge_effectbits(old.noub, new.noub),
merge_effectbits(old.nonoverlayed, new.nonoverlayed))
merge_effectbits(old.nonoverlayed, new.nonoverlayed),
merge_effectbits(old.nortcall, new.nortcall))
end

function merge_effectbits(old::UInt8, new::UInt8)
Expand All @@ -279,16 +296,18 @@ is_inaccessiblememonly(effects::Effects) = effects.inaccessiblememonly === ALWAY
is_noub(effects::Effects) = effects.noub === ALWAYS_TRUE
is_noub_if_noinbounds(effects::Effects) = effects.noub === NOUB_IF_NOINBOUNDS
is_nonoverlayed(effects::Effects) = effects.nonoverlayed === ALWAYS_TRUE
is_nortcall(effects::Effects) = effects.nortcall

# implies `is_notaskstate` & `is_inaccessiblememonly`, but not explicitly checked here
is_foldable(effects::Effects) =
is_foldable(effects::Effects, check_rtcall::Bool=false) =
is_consistent(effects) &&
(is_noub(effects) || is_noub_if_noinbounds(effects)) &&
is_effect_free(effects) &&
is_terminates(effects)
is_terminates(effects) &&
(!check_rtcall || is_nortcall(effects))

is_foldable_nothrow(effects::Effects) =
is_foldable(effects) &&
is_foldable_nothrow(effects::Effects, check_rtcall::Bool=false) =
is_foldable(effects, check_rtcall) &&
is_nothrow(effects)

# TODO add `is_noub` here?
Expand Down Expand Up @@ -318,7 +337,8 @@ function encode_effects(e::Effects)
((e.notaskstate % UInt32) << 7) |
((e.inaccessiblememonly % UInt32) << 8) |
((e.noub % UInt32) << 10) |
((e.nonoverlayed % UInt32) << 12)
((e.nonoverlayed % UInt32) << 12) |
((e.nortcall % UInt32) << 14)
end

function decode_effects(e::UInt32)
Expand All @@ -330,7 +350,8 @@ function decode_effects(e::UInt32)
_Bool((e >> 7) & 0x01),
UInt8((e >> 8) & 0x03),
UInt8((e >> 10) & 0x03),
UInt8((e >> 12) & 0x03))
UInt8((e >> 12) & 0x03),
_Bool((e >> 14) & 0x01))
end

function encode_effects_override(eo::EffectsOverride)
Expand All @@ -345,6 +366,7 @@ function encode_effects_override(eo::EffectsOverride)
eo.noub && (e |= (0x0001 << 7))
eo.noub_if_noinbounds && (e |= (0x0001 << 8))
eo.consistent_overlay && (e |= (0x0001 << 9))
eo.nortcall && (e |= (0x0001 << 10))
return e
end

Expand All @@ -359,7 +381,8 @@ function decode_effects_override(e::UInt16)
!iszero(e & (0x0001 << 6)),
!iszero(e & (0x0001 << 7)),
!iszero(e & (0x0001 << 8)),
!iszero(e & (0x0001 << 9)))
!iszero(e & (0x0001 << 9)),
!iszero(e & (0x0001 << 10)))
end

decode_statement_effects_override(ssaflag::UInt32) =
Expand Down
Loading