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

update to root. #1

Merged
merged 95 commits into from
Sep 10, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
95 commits
Select commit Hold shift + click to select a range
170c25e
fix gc in prescence of normal files
KristofferC Aug 13, 2018
2909e7c
no longer update on add
KristofferC Aug 13, 2018
5165018
Remove `--env` meta option
00vareladavid Aug 8, 2018
65964b1
Better info messages for activating new environment.
fredrikekre Aug 13, 2018
87d6669
remove unnecessary version handling when dealing with repos, this is …
KristofferC Aug 13, 2018
4e66011
add path completions to add/dev in repl
pfitzseb Aug 7, 2018
286e43b
update the repo when the gitobject is not available
KristofferC Aug 14, 2018
3c569ac
Fix a bug where the path was stored as relative
fredrikekre Aug 15, 2018
fc931e5
update docs for develop
KristofferC Aug 13, 2018
830bbce
fixup testing to be more isolated from env variables
KristofferC Jul 10, 2018
06b9df9
better path print
fredrikekre Aug 17, 2018
7b8e468
Print stdlib paths more compactly, fix #605.
fredrikekre Aug 17, 2018
2e718ca
Update Pkg docs to reflect version change to v1.0
pkofod Aug 20, 2018
18ab938
Fix `preview`
00vareladavid Aug 8, 2018
8b70a4f
Declare an argument parser for each command
00vareladavid Aug 7, 2018
3b19b42
Add a `description` field to `CommandSpec`
00vareladavid Aug 18, 2018
cf02a68
add develop for path
KristofferC Aug 13, 2018
9bc0cf9
Use max/min to declare expected argument count
00vareladavid Aug 17, 2018
d781514
work around precompile emitter failing to escape certain strings
KristofferC Aug 22, 2018
90ca61b
work around strange "Unreachable reached" when the close function for…
KristofferC Aug 22, 2018
b553d86
Make jl_ more robust during early startup
Keno Aug 27, 2018
59c7ced
Add a helpful assertion in jl_gc_big_alloc
Keno Aug 27, 2018
255030e
PTX/CUDAnative no longer needs a source build
PallHaraldsson Aug 28, 2018
68cc9f0
Rework `Libdl.dlsym()` and `jl_dlsym()`.
staticfloat Aug 24, 2018
e6f1bd7
Perform the same treatment to `dlopen()` for consistency's sake
staticfloat Aug 24, 2018
01e0c62
Make `jl_dlerror()` thread-safe
staticfloat Aug 26, 2018
99776ad
Fix botching of compile-time link bug
staticfloat Aug 26, 2018
7a3c9df
Add `JL_THREAD_LOCAL` `#define`
staticfloat Aug 26, 2018
4a5de48
Add `dlclose(::Nothing)` that does nothing
staticfloat Aug 26, 2018
595e53d
Explain `ifunc` AArch64 woes a little more thoroughly.
staticfloat Aug 26, 2018
fc27b48
Use lambda-initialization for `ptls_getter` to reap rewards of `stati…
staticfloat Aug 28, 2018
39e5742
Fix typo in accumulate docstring (#28939)
garrison Aug 29, 2018
0dd1a9a
Pkg docs: consistent home dir; show build.jl contents (#28932)
ianabc Aug 29, 2018
bd1e46a
removed outdated paragraph on automatic broadcasting for binary opera…
timziebart Aug 29, 2018
2346be8
Fix call to round for Julia 1.0 (#28944)
iht Aug 29, 2018
13cfbfe
Fix History `eye` deprecation PR: should be 24415
NHDaly Aug 30, 2018
8555aa0
Getting Started: Capitalize "CPU" for consistency
apjanke Aug 29, 2018
dabf70e
fix typo in `?@specialize`
ylxdzsw Aug 30, 2018
804d12e
Merge pull request #28977 from NHDaly/patch-2
Sacha0 Aug 31, 2018
f6fcd82
install lit and FileCheck to tools
vchuravy Aug 22, 2018
7fa6f1b
bump LLVMBuilder to rel 2
vchuravy Aug 22, 2018
eebb4af
fix llvmpasses Makefile to use lit from tools
vchuravy Aug 22, 2018
9158101
make llvmpasses test work for out-of-source
vchuravy Aug 31, 2018
d1a27f4
add make dep on build_staging for BINARYBUILDER_LLVM
vchuravy Aug 31, 2018
5bf885c
correct PATH override for test/llvmpasses
vchuravy Aug 31, 2018
d30b3df
Fix alloc opt tests
Keno Jul 28, 2018
455e669
Run the llvmpasses tests on Travis
Keno Jul 28, 2018
8acad0c
Merge pull request #28841 from JuliaLang/vc/utils
vchuravy Sep 1, 2018
d9d2b9c
Fix Libdl changes (#28953)
staticfloat Sep 1, 2018
226a4ec
Indirect checking for return_type through an extra function (#26836)
Keno Sep 1, 2018
c36c7ff
Cross reference hasmethod with applicable in docs (#28918)
angusmoore Sep 1, 2018
5ee5de4
Fix spelling of kernel in html id (#28936)
simonbyrne Sep 1, 2018
f77c36b
doc/faq: move question to correct section (#28997)
stev47 Sep 2, 2018
9ab0261
ismatch() is now occursin() not contains() (#29005)
mark-summerfield Sep 2, 2018
7453e59
Generalize condition in is_known_call
Keno Sep 1, 2018
48c6846
Fix a small typo in sroa
Keno Sep 1, 2018
9f6dbec
Also fix predicate in stmt_effect_free
Keno Sep 1, 2018
2e603aa
Docs for logging: write to file (#28927)
Sep 3, 2018
b1dac9f
Vector lowering improvents in GC placement
Keno Aug 30, 2018
49e58ba
doc: fix accumulate examples not using the init keyword (#28910)
rfourquet Sep 3, 2018
c8450d8
CartesianIndices and LinearIndices docstring (#29023)
pablosanjose Sep 4, 2018
e7d7259
Fix out of bounds write in array deserialization
Keno Sep 3, 2018
714b2c3
use default proxy credentials when downloading via powershell
KristofferC Sep 4, 2018
14fb104
Fix download agent search relying on throwing of Sys.which(). Update …
wfrgra Sep 4, 2018
d4cdde1
fix #28915, identity conversion to union of tuple types (#28951)
JeffBezanson Sep 4, 2018
c43793c
fixed regression in sparse of adjoint of sparse (#28948) (#28954)
ExpandingMan Sep 4, 2018
3fbdc9b
Merge pull request #28822 from JuliaLang/kc/pkg_bomb
ararslan Sep 4, 2018
807ae71
Fix: Enum values doesn't display UInt8 correctly (#29035)
mimame Sep 5, 2018
8d99356
Fix dispatch of SparseMatrixCSC*Diagonal multiplication (#29045)
Pbellive Sep 5, 2018
1fb86d2
fix #28900, macro hygiene bug inside keyword arg values (#29043)
JeffBezanson Sep 5, 2018
11e32a4
fix #28991, error when adding default defs to constructed module Expr…
JeffBezanson Sep 5, 2018
4c02077
make sure that the read task is done when precompiling (#29024)
KristofferC Sep 6, 2018
53f8e18
Fix typo on file.jl (#29063)
zsz00 Sep 6, 2018
be14985
Fix typo in mapreduce docstring (#29049)
harryscholes Sep 6, 2018
a42f4d5
fix docstring of open(command) (close #24649) (#25563)
bicycle1885 Sep 6, 2018
e5cc750
fix #28833, crash in macros returning certain top-level forms (#28882)
JeffBezanson Sep 6, 2018
88d536a
work around a splatting penalty in twiceprecision (#29060)
KristofferC Sep 6, 2018
bda5dd8
add local to outer description (#29010)
bkamins Sep 6, 2018
5c1d4a3
comment out assertion
KristofferC Sep 7, 2018
4b103ef
stronger warnings about changing constants in help and docs (#28711)
JeffBezanson Sep 7, 2018
cfca833
fix #29064, bug in field name same as struct type name (#29070)
JeffBezanson Sep 7, 2018
bb7d043
fix #25955, hygiene of arg name of function defined by type (`(f::T)(…
JeffBezanson Sep 7, 2018
a572504
Documentation `mynorm` should not divide by n (#29091)
dehann Sep 8, 2018
42e8920
fix logic in `getfield_nothrow` to allow removing more getfields
JeffBezanson Sep 7, 2018
65e4c13
fix #29083, not eliminating kwfunc due to logic error in builtin_nothrow
JeffBezanson Sep 7, 2018
f922a63
fix #29036, poor inference of `val,i = iterate(x,i)`
JeffBezanson Sep 7, 2018
3057ebc
slightly more efficient lowering of destructuring assignment
JeffBezanson Sep 7, 2018
92cef07
Allow CFG transforms during compaction
Keno Aug 30, 2018
3ed9599
Eliminate useless PiNodes during compaction
Keno Sep 1, 2018
fda953b
Kill useless phi nodes
Keno Sep 1, 2018
0c73ad1
doc/interface: correct signature of `size` (#29094)
iblislin Sep 8, 2018
68db9b4
This comma confused me. Remove it
pepsiman Sep 8, 2018
1ab5319
Allow eliminating ifelse if proven nothrow
Keno Sep 8, 2018
ecff881
Avoid duplicated =value in Enum errors.
jmert Sep 8, 2018
97864d3
Adding text on how to embed Julia on Windows. (#28974)
NiklasGustafsson Sep 9, 2018
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
3 changes: 3 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,9 @@ script:
# restore initial state and prepare for travis caching
- mv julia2 julia &&
rm -f julia/deps/scratch/libgit2-*/CMakeFiles/CMakeOutput.log
# run the LLVM tests on Linux
- if [ `uname` = "Linux" ]; then
pushd julia && make -C test/llvmpasses && popd; fi
# run the doctests on Linux 64-bit
- if [ `uname` = "Linux" ] && [ $ARCH = "x86_64" ]; then
pushd julia && make -C doc doctest=true && popd; fi
Expand Down
5 changes: 3 additions & 2 deletions HISTORY.md
Original file line number Diff line number Diff line change
Expand Up @@ -625,7 +625,7 @@ Library improvements
* The `crc32c` function for CRC-32c checksums is now exported ([#22274]).

* `eye(::Type{Diagonal{T}}, m::Integer)` has been deprecated in favor of
`Diagonal{T}(I, m)` ([#24413]).
`Diagonal{T}(I, m)` ([#24415]).

* The output of `versioninfo` is now controlled with keyword arguments ([#21974]).

Expand Down Expand Up @@ -1247,7 +1247,7 @@ Deprecated or removed
* `search(buf::IOBuffer, delim::UInt8)` has been deprecated in favor of either `occursin(delim, buf)`
(to test containment) or `readuntil(buf, delim)` (to read data up to `delim`) ([#26600]).

* `ismatch(regex, str)` has been deprecated in favor of `contains(str, regex)` ([#24673]).
* `ismatch(regex, str)` has been deprecated in favor of `occursin(regex, str)` ([#26283]).

* `matchall` has been deprecated in favor of `collect(m.match for m in eachmatch(r, s))` ([#26071]).

Expand Down Expand Up @@ -1575,6 +1575,7 @@ Command-line option changes
[#24404]: https://github.com/JuliaLang/julia/issues/24404
[#24413]: https://github.com/JuliaLang/julia/issues/24413
[#24414]: https://github.com/JuliaLang/julia/issues/24414
[#24415]: https://github.com/JuliaLang/julia/issues/24415
[#24438]: https://github.com/JuliaLang/julia/issues/24438
[#24445]: https://github.com/JuliaLang/julia/issues/24445
[#24452]: https://github.com/JuliaLang/julia/issues/24452
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ all: debug release
# sort is used to remove potential duplicates
DIRS := $(sort $(build_bindir) $(build_depsbindir) $(build_libdir) $(build_private_libdir) $(build_libexecdir) $(build_includedir) $(build_includedir)/julia $(build_sysconfdir)/julia $(build_datarootdir)/julia $(build_datarootdir)/julia/stdlib $(build_man1dir))
ifneq ($(BUILDROOT),$(JULIAHOME))
BUILDDIRS := $(BUILDROOT) $(addprefix $(BUILDROOT)/,base src ui doc deps test test/embedding)
BUILDDIRS := $(BUILDROOT) $(addprefix $(BUILDROOT)/,base src ui doc deps test test/embedding test/llvmpasses)
BUILDDIRMAKE := $(addsuffix /Makefile,$(BUILDDIRS))
DIRS := $(DIRS) $(BUILDDIRS)
$(BUILDDIRMAKE): | $(BUILDDIRS)
Expand Down Expand Up @@ -206,7 +206,7 @@ define sysimg_builder
$$(build_private_libdir)/sys$1-o.a $$(build_private_libdir)/sys$1-bc.a : $$(build_private_libdir)/sys$1-%.a : $$(build_private_libdir)/sys.ji
@$$(call PRINT_JULIA, cd $$(JULIAHOME)/base && \
if ! $$(call spawn,$3) $2 -C "$$(JULIA_CPU_TARGET)" --output-$$* $$(call cygpath_w,$$@).tmp $$(JULIA_SYSIMG_BUILD_FLAGS) \
--startup-file=no --warn-overwrite=yes --sysimage $$(call cygpath_w,$$<) $$(call cygpath_w,$$(JULIAHOME)/contrib/generate_precompile.jl) $$(call cygpath_w,$$<); then \
--startup-file=no --warn-overwrite=yes --sysimage $$(call cygpath_w,$$<) $$(call cygpath_w,$$(JULIAHOME)/contrib/generate_precompile.jl); then \
echo '*** This error is usually fixed by running `make clean`. If the error persists$$(COMMA) try `make cleanall`. ***'; \
false; \
fi )
Expand Down
14 changes: 12 additions & 2 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,21 @@ Refer to the [Release Notes for
v0.7](https://github.com/JuliaLang/julia/blob/master/HISTORY.md) for a
detailed list of changes from Julia v0.6.

Standard Library Changes
------------------------

* The `Libdl` module's methods `dlopen()` and `dlsym()` have gained a
`throw_error` keyword argument, replacing the now-deprecated `dlopen_e()`
and `dlsym_e()` methods. When `throw_error` is `false`, failure to locate
a shared library or symbol will return `nothing` rather than `C_NULL`.
([#28888])

Deprecated or removed
---------------------

The old package manager (now called `OldPkg`) has been moved to a
separate repository at https://github.com/JuliaArchive/OldPkg.jl ([#27930])
* The old package manager (now called `OldPkg`) has been moved to a
separate repository at https://github.com/JuliaArchive/OldPkg.jl ([#27930])

<!--- generated by NEWS-update.jl: -->
[#27930]: https://github.com/JuliaLang/julia/issues/27930
[#28888]: https://github.com/JuliaLang/julia/issues/28888
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ Julia is built and tested regularly on the following platforms:
| FreeBSD 11.0+ | x86-64 (64-bit) | ✓ | | Community |

All systems marked with ✓ for CI are tested using continuous integration for every commit.
Systems with ✓ for binaries have official binaries available on the [downloads](https://julialang.org/downloads) page and are tested regularly. The PTX backend needs a source build and the [CUDAnative.jl](https://github.com/JuliaGPU/CUDAnative.jl) package.
Systems with ✓ for binaries have official binaries available on the [downloads](https://julialang.org/downloads) page and are tested regularly. The PTX backend needs the [CUDAnative.jl](https://github.com/JuliaGPU/CUDAnative.jl) package.
The systems listed here with neither CI nor official binaries are known to build and work, but ongoing support for those platforms is dependent on community efforts.
It is possible that Julia will build and work on other platforms too, and we're always looking to better our platform coverage.
If you're using Julia on a platform not listed here, let us know!
Expand Down
5 changes: 3 additions & 2 deletions base/Enums.jl
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ macro enum(T, syms...)
length(s.args) == 2 && isa(s.args[1], Symbol)
i = Core.eval(__module__, s.args[2]) # allow exprs, e.g. uint128"1"
if !isa(i, Integer)
throw(ArgumentError("invalid value for Enum $typename, $s=$i; values must be integers"))
throw(ArgumentError("invalid value for Enum $typename, $s; values must be integers"))
end
i = convert(basetype, i)
s = s.args[1]
Expand Down Expand Up @@ -154,7 +154,8 @@ macro enum(T, syms...)
else
print(io, x, "::")
show(IOContext(io, :compact => true), typeof(x))
print(io, " = ", $basetype(x))
print(io, " = ")
show(io, $basetype(x))
end
end
function Base.show(io::IO, t::Type{$(esc(typename))})
Expand Down
2 changes: 1 addition & 1 deletion base/accumulate.jl
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ cumprod(x::AbstractVector) = cumprod(x, dims=1)
accumulate(op, A; dims::Integer, [init])

Cumulative operation `op` along the dimension `dims` of `A` (providing `dims` is optional
for vectors). An inital value `init` may optionally be provided by a keyword argument. See
for vectors). An initial value `init` may optionally be provided by a keyword argument. See
also [`accumulate!`](@ref) to use a preallocated output array, both for performance and
to control the precision of the output (e.g. to avoid overflow). For common operations
there are specialized variants of `accumulate`, see: [`cumsum`](@ref), [`cumprod`](@ref)
Expand Down
31 changes: 21 additions & 10 deletions base/compiler/abstractinterpretation.jl
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,15 @@ function abstract_call_gf_by_type(@nospecialize(f), argtypes::Vector{Any}, @nosp
rettype = Bottom
edgecycle = false
edges = Any[]
nonbot = 0 # the index of the only non-Bottom inference result if > 0
seen = 0 # number of signatures actually inferred
for i in 1:napplicable
match = applicable[i]::SimpleVector
method = match[3]::Method
sig = match[1]
sigtuple = unwrap_unionall(sig)::DataType
splitunions = false
this_rt = Bottom
# TODO: splitunions = 1 < countunionsplit(sigtuple.parameters) * napplicable <= sv.params.MAX_UNION_SPLITTING
# currently this triggers a bug in inference recursion detection
if splitunions
Expand All @@ -71,24 +74,32 @@ function abstract_call_gf_by_type(@nospecialize(f), argtypes::Vector{Any}, @nosp
push!(edges, edge)
end
edgecycle |= edgecycle1::Bool
rettype = tmerge(rettype, rt)
rettype === Any && break
this_rt = tmerge(this_rt, rt)
this_rt === Any && break
end
rettype === Any && break
else
rt, edgecycle, edge = abstract_call_method(method, sig, match[2]::SimpleVector, sv)
this_rt, edgecycle, edge = abstract_call_method(method, sig, match[2]::SimpleVector, sv)
if edge !== nothing
push!(edges, edge)
end
rettype = tmerge(rettype, rt)
rettype === Any && break
end
if this_rt !== Bottom
if nonbot === 0
nonbot = i
else
nonbot = -1
end
end
seen += 1
rettype = tmerge(rettype, this_rt)
rettype === Any && break
end
if napplicable == 1 && !edgecycle && isa(rettype, Type) && sv.params.ipo_constant_propagation
# try constant propagation if only 1 method is inferred to non-Bottom
if nonbot > 0 && seen == napplicable && !edgecycle && isa(rettype, Type) && sv.params.ipo_constant_propagation
# if there's a possibility we could constant-propagate a better result
# (hopefully without doing too much work), try to do that now
# TODO: it feels like this could be better integrated into abstract_call_method / typeinf_edge
const_rettype = abstract_call_method_with_const_args(f, argtypes, applicable[1]::SimpleVector, sv)
const_rettype = abstract_call_method_with_const_args(f, argtypes, applicable[nonbot]::SimpleVector, sv)
if const_rettype ⊑ rettype
# use the better result, if it's a refinement of rettype
rettype = const_rettype
Expand Down Expand Up @@ -704,7 +715,7 @@ function abstract_call(@nospecialize(f), fargs::Union{Tuple{},Vector{Any}}, argt
return ret
end
return Any
elseif f === return_type
elseif is_return_type(f)
rt_rt = return_type_tfunc(argtypes, vtypes, sv)
if rt_rt !== NOT_FOUND
return rt_rt
Expand Down Expand Up @@ -755,7 +766,7 @@ function abstract_call(@nospecialize(f), fargs::Union{Tuple{},Vector{Any}}, argt
t = pure_eval_call(f, argtypes, atype, sv)
t !== false && return t

if istopfunction(f, :typejoin) || f === return_type
if istopfunction(f, :typejoin) || is_return_type(f)
return Type # don't try to infer these function edges directly -- it won't actually come up with anything useful
end

Expand Down
1 change: 1 addition & 0 deletions base/compiler/compiler.jl
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ include("options.jl")

# core operations & types
function return_type end # promotion.jl expects this to exist
is_return_type(@Core.nospecialize(f)) = f === return_type
include("promotion.jl")
include("tuple.jl")
include("pair.jl")
Expand Down
2 changes: 1 addition & 1 deletion base/compiler/optimize.jl
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ const _PURE_BUILTINS = Any[tuple, svec, ===, typeof, nfields]
const _PURE_OR_ERROR_BUILTINS = [
fieldtype, apply_type, isa, UnionAll,
getfield, arrayref, isdefined, Core.sizeof,
Core.kwfunc
Core.kwfunc, ifelse
]

const TOP_TUPLE = GlobalRef(Core, :tuple)
Expand Down
2 changes: 1 addition & 1 deletion base/compiler/ssair/driver.jl
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,9 @@ function run_passes(ci::CodeInfo, nargs::Int, sv::OptimizationState)
@timeit "compact 1" ir = compact!(ir)
@timeit "Inlining" ir = ssa_inlining_pass!(ir, ir.linetable, sv)
#@timeit "verify 2" verify_ir(ir)
@timeit "domtree 2" domtree = construct_domtree(ir.cfg)
ir = compact!(ir)
#@Base.show ("before_sroa", ir)
@timeit "domtree 2" domtree = construct_domtree(ir.cfg)
@timeit "SROA" ir = getfield_elim_pass!(ir, domtree)
#@Base.show ir.new_nodes
#@Base.show ("after_sroa", ir)
Expand Down
43 changes: 31 additions & 12 deletions base/compiler/ssair/inlining.jl
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ mutable struct CFGInliningState
todo_bbs::Vector{Tuple{Int, Int}}
first_bb::Int
bb_rename::Vector{Int}
dead_blocks::Vector{Int}
split_targets::BitSet
merged_orig_blocks::BitSet
cfg::CFG
Expand All @@ -82,6 +83,7 @@ function CFGInliningState(ir::IRCode)
Tuple{Int, Int}[],
0,
zeros(Int, length(ir.cfg.blocks)),
Vector{Int}(),
BitSet(),
BitSet(),
ir.cfg
Expand Down Expand Up @@ -172,18 +174,24 @@ function cfg_inline_item!(item::InliningTodo, state::CFGInliningState, from_unio
push!(state.new_cfg_blocks[first(bb_rename_range)].preds, first(bb_rename_range)-1)
end

any_edges = false
for (old_block, new_block) in enumerate(bb_rename_range)
if (length(state.new_cfg_blocks[new_block].succs) == 0)
terminator_idx = last(inlinee_cfg.blocks[old_block].stmts)
terminator = item.ir[SSAValue(terminator_idx)]
if isa(terminator, ReturnNode) && isdefined(terminator, :val)
any_edges = true
push!(state.new_cfg_blocks[new_block].succs, post_bb_id)
if need_split
push!(state.new_cfg_blocks[post_bb_id].preds, new_block)
end
end
end
end

if !any_edges
push!(state.dead_blocks, post_bb_id)
end
end

function cfg_inline_unionsplit!(item::UnionSplit, state::CFGInliningState)
Expand Down Expand Up @@ -263,6 +271,13 @@ function finish_cfg_inline!(state::CFGInliningState)
return succ_bb < 0 ? state.bb_rename[-succ_bb] : succ_bb
end
end

# Kill dead blocks
for block in state.dead_blocks
for succ in state.new_cfg_blocks[block].succs
kill_edge!(state.new_cfg_blocks, block, succ)
end
end
end

function ir_inline_item!(compact::IncrementalCompact, idx::Int, argexprs::Vector{Any},
Expand Down Expand Up @@ -322,7 +337,7 @@ function ir_inline_item!(compact::IncrementalCompact, idx::Int, argexprs::Vector
# This implements the need_split_before flag above
need_split_before = !isempty(item.ir.cfg.blocks[1].preds)
if need_split_before
finish_current_bb!(compact)
finish_current_bb!(compact, 0)
end
pn = PhiNode()
#compact[idx] = nothing
Expand Down Expand Up @@ -413,7 +428,7 @@ function ir_inline_unionsplit!(compact::IncrementalCompact, idx::Int,
end
insert_node_here!(compact, GotoIfNot(cond, next_cond_bb), Union{}, line)
bb = next_cond_bb - 1
finish_current_bb!(compact)
finish_current_bb!(compact, 0)
argexprs′ = argexprs
if !isa(case, ConstantCase)
argexprs′ = copy(argexprs)
Expand All @@ -434,24 +449,28 @@ function ir_inline_unionsplit!(compact::IncrementalCompact, idx::Int,
case = case::ConstantCase
val = case.val
end
push!(pn.edges, bb)
push!(pn.values, val)
insert_node_here!(compact, GotoNode(join_bb), Union{}, line)
finish_current_bb!(compact)
if !isempty(compact.result_bbs[bb].preds)
push!(pn.edges, bb)
push!(pn.values, val)
insert_node_here!(compact, GotoNode(join_bb), Union{}, line)
else
insert_node_here!(compact, ReturnNode(), Union{}, line)
end
finish_current_bb!(compact, 0)
end
bb += 1
# We're now in the fall through block, decide what to do
if item.fully_covered
e = Expr(:call, GlobalRef(Core, :throw), fatal_type_bound_error)
insert_node_here!(compact, e, Union{}, line)
insert_node_here!(compact, ReturnNode(), Union{}, line)
finish_current_bb!(compact)
finish_current_bb!(compact, 0)
else
ssa = insert_node_here!(compact, stmt, typ, line)
push!(pn.edges, bb)
push!(pn.values, ssa)
insert_node_here!(compact, GotoNode(join_bb), Union{}, line)
finish_current_bb!(compact)
finish_current_bb!(compact, 0)
end

# We're now in the join block.
Expand Down Expand Up @@ -479,7 +498,7 @@ function batch_inline!(todo::Vector{Any}, ir::IRCode, linetable::Vector{LineInfo
boundscheck = :propagate
end

let compact = IncrementalCompact(ir)
let compact = IncrementalCompact(ir, false)
compact.result_bbs = state.new_cfg_blocks
# This needs to be a minimum and is more of a size hint
nn = 0
Expand Down Expand Up @@ -517,7 +536,7 @@ function batch_inline!(todo::Vector{Any}, ir::IRCode, linetable::Vector{LineInfo
ir_inline_unionsplit!(compact, idx, argexprs, linetable, item, boundscheck, state.todo_bbs)
end
compact[idx] = nothing
refinish && finish_current_bb!(compact)
refinish && finish_current_bb!(compact, 0)
if !isempty(todo)
item = popfirst!(todo)
inline_idx = item.idx
Expand Down Expand Up @@ -847,7 +866,7 @@ function assemble_inline_todo!(ir::IRCode, linetable::Vector{LineInfoNode}, sv::
sv.params.inlining || continue

# Special case inliners for regular functions
if late_inline_special_case!(ir, idx, stmt, atypes, f, ft) || f === return_type
if late_inline_special_case!(ir, idx, stmt, atypes, f, ft) || is_return_type(f)
continue
end

Expand Down Expand Up @@ -1061,7 +1080,7 @@ function late_inline_special_case!(ir::IRCode, idx::Int, stmt::Expr, atypes::Vec
subtype_call = Expr(:call, GlobalRef(Core, :(<:)), stmt.args[3], stmt.args[2])
ir[SSAValue(idx)] = subtype_call
return true
elseif f === return_type
elseif is_return_type(f)
if isconstType(typ)
ir[SSAValue(idx)] = quoted(typ.parameters[1])
return true
Expand Down
Loading