https://github.com/JuliaLang/julia
Revision 16e61e25c7e15280b1e3c11b549b410e324175c4 authored by Keno Fischer on 11 November 2023, 00:47:53 UTC, committed by GitHub on 11 November 2023, 00:47:53 UTC
Currently [1] it is illegal [2] in IRCode to have a GlobalRef in value
position that could potentially throw. This is because in IRCode, we
want to assign flags to every statement and if there are multiple things
with effects in a statement, we lose precision in tracking which they
apply to. However, we currently do allow this in `CodeInfo`. Now that
we're starting to make more use of flags in inference also, this is
becoming annoying (as it did for IRCode), so I would like to do this
transformation earlier. This is an attempt to do this during lowering.
It is not entirely clear that this is precisely the correct place for
it. We could alternatively consider doing it during the global resolve
pass in method.c, but that currently does not renumber SSAValues, so
doing it during the renumbering inside lowering may be easier.

N.B.: This is against #51853, because this needs some of the inference
precision improvements in that PR to avoid regressing the try/catch
elision tests (which before that PR, we were incorrectly computing
effects for statement-position GlobalRefs).

[1]
https://github.com/JuliaLang/julia/commit/39c278b728deb04c3a32d70e3e35dcef7822c0c0
[2]
https://github.com/JuliaLang/julia/blob/2f63cc99fb134fb4adb7f11ba86a4e2ab5adcd48/base/compiler/ssair/verify.jl#L54-L58

---------

Co-authored-by: Jeff Bezanson <jeff.bezanson@gmail.com>
Co-authored-by: Oscar Smith <oscardssmith@gmail.com>
1 parent 8944a22
History
Tip revision: 16e61e25c7e15280b1e3c11b549b410e324175c4 authored by Keno Fischer on 11 November 2023, 00:47:53 UTC
Outline potentially undefined globals during lowering (#51970)
Tip revision: 16e61e2
File Mode Size
.devcontainer
.github
base
cli
contrib
deps
doc
etc
src
stdlib
test
.buildkite-external-version -rw-r--r-- 5 bytes
.clang-format -rw-r--r-- 3.3 KB
.clangd -rw-r--r-- 114 bytes
.codecov.yml -rw-r--r-- 52 bytes
.git-blame-ignore-revs -rw-r--r-- 371 bytes
.gitattributes -rw-r--r-- 65 bytes
.gitignore -rw-r--r-- 523 bytes
.mailmap -rw-r--r-- 12.7 KB
CITATION.bib -rw-r--r-- 513 bytes
CITATION.cff -rw-r--r-- 940 bytes
CONTRIBUTING.md -rw-r--r-- 23.4 KB
HISTORY.md -rw-r--r-- 372.8 KB
LICENSE.md -rw-r--r-- 1.3 KB
Make.inc -rw-r--r-- 55.9 KB
Makefile -rw-r--r-- 30.3 KB
NEWS.md -rw-r--r-- 5.1 KB
README.md -rw-r--r-- 7.3 KB
THIRDPARTY.md -rw-r--r-- 3.8 KB
VERSION -rw-r--r-- 11 bytes
julia.spdx.json -rw-r--r-- 35.8 KB
pkgimage.mk -rw-r--r-- 6.1 KB
sysimage.mk -rw-r--r-- 4.2 KB
typos.toml -rw-r--r-- 78 bytes

README.md

back to top