https://github.com/JuliaLang/julia
Revision 9df47f238c44a92ca0962efbc4c42173d0c5ce54 authored by Shuhei Kadowaki on 19 March 2024, 11:10:11 UTC, committed by GitHub on 19 March 2024, 11:10:11 UTC
This commit fixes the first problem that was found while digging into JuliaLang/julia#53613. It turns out that the post-domtree constructed from regular `IRCode` doesn't work for visiting conditional successors for post-opt analysis in cases like: ```julia julia> let code = Any[ # block 1 GotoIfNot(Argument(2), 3), # block 2 ReturnNode(Argument(3)), # block 3 (we should visit this block) Expr(:call, throw, "potential throw"), ReturnNode(), # unreachable ] ir = make_ircode(code; slottypes=Any[Any,Bool,Bool]) visited = BitSet() @test !Core.Compiler.visit_conditional_successors(CC.LazyPostDomtree(ir), ir, #=bb=#1) do succ::Int push!(visited, succ) return false end @test 2 ∉ visited @test 3 ∈ visited end Test Failed at REPL[14]:16 Expression: 2 ∉ visited Evaluated: 2 ∉ BitSet([2]) ``` This might mean that we need to fix on the `postdominates` end, but for now, this commit tries to get around it by using the augmented post domtree in `visit_conditional_successors`. Since the augmented post domtree is enforced to have a single return, we can keep using the current `postdominates` to fix the issue. However, this commit isn't enough to fix the NeuralNetworkReachability segfault as reported in #53613, and we need to tackle the second issue reported there too (https://github.com/JuliaLang/julia/issues/53613#issuecomment-1983243419).
1 parent 2775c9a
Tip revision: 9df47f238c44a92ca0962efbc4c42173d0c5ce54 authored by Shuhei Kadowaki on 19 March 2024, 11:10:11 UTC
post-opt: add more test cases for `visit_conditional_successors` (#53642)
post-opt: add more test cases for `visit_conditional_successors` (#53642)
Tip revision: 9df47f2
NEWS.md
Julia v1.12 Release Notes
========================
New language features
---------------------
Language changes
----------------
- When methods are replaced with exactly equivalent ones, the old method is no
longer deleted implicitly simultaneously, although the new method does take
priority and become more specific than the old method. Thus if the new
method is deleted later, the old method will resume operating. This can be
useful to mocking frameworks (such as in SparseArrays, Pluto, and Mocking,
among others), as they do not need to explicitly restore the old method.
While inference and compilation still must be repeated with this, it also
may pave the way for inference to be able to intelligently re-use the old
results, once the new method is deleted. ([#53415])
- Macro expansion will no longer eargerly recurse into into `Expr(:toplevel)`
expressions returned from macros. Instead, macro expansion of `:toplevel`
expressions will be delayed until evaluation time. This allows a later
expression within a given `:toplevel` expression to make use of macros
defined earlier in the same `:toplevel` expression. ([#53515])
Compiler/Runtime improvements
-----------------------------
Command-line option changes
---------------------------
* The `-m/--module` flag can be passed to run the `main` function inside a package with a set of arguments.
This `main` function should be declared using `@main` to indicate that it is an entry point.
Multi-threading changes
-----------------------
Build system changes
--------------------
New library functions
---------------------
* `logrange(start, stop; length)` makes a range of constant ratio, instead of constant step ([#39071])
* The new `isfull(c::Channel)` function can be used to check if `put!(c, some_value)` will block. ([#53159])
* `waitany(tasks; throw=false)` and `waitall(tasks; failfast=false, throw=false)` which wait multiple tasks at once ([#53341]).
New library features
--------------------
* `invmod(n, T)` where `T` is a native integer type now computes the modular inverse of `n` in the modular integer ring that `T` defines ([#52180]).
* `invmod(n)` is an abbreviation for `invmod(n, typeof(n))` for native integer types ([#52180]).
* `replace(string, pattern...)` now supports an optional `IO` argument to
write the output to a stream rather than returning a string ([#48625]).
* `sizehint!(s, n)` now supports an optional `shrink` argument to disable shrinking ([#51929]).
* New function `Docs.hasdoc(module, symbol)` tells whether a name has a docstring ([#52139]).
* New function `Docs.undocumented_names(module)` returns a module's undocumented public names ([#52413]).
* Passing an `IOBuffer` as a stdout argument for `Process` spawn now works as
expected, synchronized with `wait` or `success`, so a `Base.BufferStream` is
no longer required there for correctness to avoid data races ([#52461]).
* After a process exits, `closewrite` will no longer be automatically called on
the stream passed to it. Call `wait` on the process instead to ensure the
content is fully written, then call `closewrite` manually to avoid
data-races. Or use the callback form of `open` to have all that handled
automatically.
* `@timed` now additionally returns the elapsed compilation and recompilation time ([#52889])
* `filter` can now act on a `NamedTuple` ([#50795]).
* `tempname` can now take a suffix string to allow the file name to include a suffix and include that suffix in
the uniquing checking ([#53474])
* `RegexMatch` objects can now be used to construct `NamedTuple`s and `Dict`s ([#50988])
Standard library changes
------------------------
#### StyledStrings
#### JuliaSyntaxHighlighting
#### Package Manager
#### LinearAlgebra
#### Logging
#### Printf
#### Profile
#### Random
#### REPL
#### SuiteSparse
#### SparseArrays
#### Test
#### Dates
#### Statistics
#### Distributed
#### Unicode
#### DelimitedFiles
#### InteractiveUtils
Deprecated or removed
---------------------
External dependencies
---------------------
Tooling Improvements
--------------------
<!--- generated by NEWS-update.jl: -->
![swh spinner](/static/img/swh-spinner.gif)
Computing file changes ...