https://github.com/JuliaLang/julia
Revision 44a791526708f0c56633992f38d1445ffad1116e authored by Keno Fischer on 23 December 2023, 05:07:47 UTC, committed by GitHub on 23 December 2023, 05:07:47 UTC
This fixes #52610. The underlying issue is a left over OldSSAValue after
the adce_pass! (introduced by compaction, it being during adce is
incidental). Compaction introduces `OldSSAValue` when it compacts in
PhiNodes that reference later SSAValues and adds them to a list to
revisit at the end of compaction to fill in the actual renamed result.
There are two separate fixes here:

1. If the result of the final revisit is yet another `OldSSAValue`,
rename it again. I don't this ordinarily happens at all, but I suppose
it is possible in theory during sroa beacuse of the rename-shortcut
optimization [1]. However, this is not not what happened here. Instead
compaction incorrectly used an OldSSAValue for an already-inserted node,
which then ends up in the rename list because we deleted one of the
predecessor edges [2]. To fix that we:

2. Fix an issue where we weren't accounting for the possibility of
previously pending nodes (which have SSAValues beyond the numbering
range of the ordinary statements) in the special already_inserted query
in phinode value processing. To fix this, unify the logic with the
ordinary `already_inserted` query, which handles this case correctly.

[1]
https://github.com/JuliaLang/julia/blob/9443c761871c4db9c3213a1e01804286292c3f4d/base/compiler/ssair/passes.jl#L1385
[2]
https://github.com/JuliaLang/julia/blob/9443c761871c4db9c3213a1e01804286292c3f4d/base/compiler/ssair/ir.jl#L1556

Co-authored-by: Tim Besard <tim@juliahub.com>
1 parent 4975a78
History
Tip revision: 44a791526708f0c56633992f38d1445ffad1116e authored by Keno Fischer on 23 December 2023, 05:07:47 UTC
ir: Fix incorrect renaming of phinode values (#52614)
Tip revision: 44a7915
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-- 8.1 KB
README.md -rw-r--r-- 7.4 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-- 5.8 KB
sysimage.mk -rw-r--r-- 4.2 KB
typos.toml -rw-r--r-- 78 bytes

README.md

back to top