-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Compiler bug uncovered by BaseBenchmarks #29107
Comments
For my own reference:
The issue seems to be that the pass is looking at invalid IR in dead code (which I explicitly allowed in the CFG transform PR to avoid having to figure out instantaneously what code is dead). I guess I do have to track that. |
My intuition says we should compute and keep dfs numbers and update them on edge deletion, but that doesn't seem like a super great option, so I'm open to other suggestions. |
Of course we could also consider just keeping the domtree updated. |
It looks like I have run into the same (or similar) problem with ApproxFun. This error started happening on master on Friday (I think?) Here is the trigger and the top of the stack trace. It looks like the error is occuring when eval'ing what will become sinh for the Funs. It actually completes and on subsequent call to tanh, sinh everything is fine so it is in the eval, I think, located at
|
This commit replaces the naive algorithm for replacing dominator trees by a faster implementation based on the Semi-NCA algorithm (reference in the code comments). LLVM recently switched to this algorithm and found it to be faster in practice than SLT (which it used before). It is also slightly easier to implement. More importantly though, it should easily extend to dynamic dominators. I'm hoping this will fix the performance problems with constructing dominators noted in #25927 as well as providing the basis for a dynamic dominator implementation to fix #29107.
This commit replaces the naive algorithm for replacing dominator trees by a faster implementation based on the Semi-NCA algorithm (reference in the code comments). LLVM recently switched to this algorithm and found it to be faster in practice than SLT (which it used before). It is also slightly easier to implement. More importantly though, it should easily extend to dynamic dominators. I'm hoping this will fix the performance problems with constructing dominators noted in #25927 as well as providing the basis for a dynamic dominator implementation to fix #29107.
I am seeing the following error in Hecke on julia master. Is this the same? Internal error: encountered unexpected error in runtime:
BoundsError(a=Array{Any, (512,)}[
...
rec_backtrace at /tmpbig/thofmann/juliagit/src/stackwalk.c:94
record_backtrace at /tmpbig/thofmann/juliagit/src/task.c:249
jl_throw at /tmpbig/thofmann/juliagit/src/task.c:580
jl_bounds_error_ints at /tmpbig/thofmann/juliagit/src/rtutils.c:187
getindex at ./array.jl:731 [inlined]
fixup_phinode_values! at ./compiler/ssair/ir.jl:1159
fixup_node at ./compiler/ssair/ir.jl:1173
just_fixup! at ./compiler/ssair/ir.jl:1198
non_dce_finish! at ./compiler/ssair/ir.jl:1231
finish at ./compiler/ssair/ir.jl:1240 [inlined]
batch_inline! at ./compiler/ssair/inlining.jl:557
ssa_inlining_pass! at ./compiler/ssair/inlining.jl:63 [inlined]
run_passes at ./compiler/ssair/driver.jl:118
optimize at ./compiler/optimize.jl:162
typeinf at ./compiler/typeinfer.jl:35
typeinf_edge at ./compiler/typeinfer.jl:492
abstract_call_method at ./compiler/abstractinterpretation.jl:342 |
Yes, could be related, but not necessarily. I'm hoping to have this fixed properly shortly. If not resolved afterwards, please file as a separate issue. |
CFG transforms can currently cause issues like #29107, but I'm still a few days away from fixing this properly. In the meantime, disable the transform.
CFG transforms can currently cause issues like #29107, but I'm still a few days away from fixing this properly. In the meantime, disable the transform.
CFG transforms can currently cause issues like #29107, but I'm still a few days away from fixing this properly. In the meantime, disable the transform.
I saw a very similar issue with julia> using CSV
[ Info: Precompiling CSV [336ed68f-0bac-5ca0-87d4-7b16caf5d00b]
Internal error: encountered unexpected error in runtime:
BoundsError(a=Array{Int64, (7,)}[1, 2, 3, 4, 5, 6, 7], i=(0,))
rec_backtrace at /home/mbauman/julia/src/stackwalk.c:94
record_backtrace at /home/mbauman/julia/src/task.c:249
jl_throw at /home/mbauman/julia/src/task.c:580
jl_bounds_error_ints at /home/mbauman/julia/src/rtutils.c:182
getindex at ./array.jl:731 [inlined]
#235 at ./compiler/ssair/ir.jl:924
jfptr_#235_2351 at /home/mbauman/julia/usr/lib/julia/sys.so (unknown line)
jl_apply_generic at /home/mbauman/julia/src/gf.c:2198
map! at ./abstractarray.jl:1990
process_node! at ./compiler/ssair/ir.jl:924
process_node! at ./compiler/ssair/ir.jl:945 [inlined]
iterate at ./compiler/ssair/ir.jl:1109
getfield_elim_pass! at ./compiler/ssair/passes.jl:688
run_passes at ./compiler/ssair/driver.jl:123
optimize at ./compiler/optimize.jl:162 |
I do want to fix this, so I'll leave this issue open. That PR just reverted the compiler improvement that uncovered this. |
This commit replaces the naive algorithm for replacing dominator trees by a faster implementation based on the Semi-NCA algorithm (reference in the code comments). LLVM recently switched to this algorithm and found it to be faster in practice than SLT (which it used before). It is also slightly easier to implement. More importantly though, it should easily extend to dynamic dominators. I'm hoping this will fix the performance problems with constructing dominators noted in #25927 as well as providing the basis for a dynamic dominator implementation to fix #29107.
This commit replaces the naive algorithm for replacing dominator trees by a faster implementation based on the Semi-NCA algorithm (reference in the code comments). LLVM recently switched to this algorithm and found it to be faster in practice than SLT (which it used before). It is also slightly easier to implement. More importantly though, it should easily extend to dynamic dominators. This fixes the preformance problems in dominator construction noted in #25927 and should provide a basis for a dynamic dominator implementation to fix #29107.
This commit replaces the naive algorithm for replacing dominator trees by a faster implementation based on the Semi-NCA algorithm (reference in the code comments). LLVM recently switched to this algorithm and found it to be faster in practice than SLT (which it used before). It is also slightly easier to implement. More importantly though, it should easily extend to dynamic dominators. This fixes the preformance problems in dominator construction noted in #25927 and should provide a basis for a dynamic dominator implementation to fix #29107.
CFG transforms can currently cause issues like #29107, but I'm still a few days away from fixing this properly. In the meantime, disable the transform.
Phi nodes are optimized away when there is only one predecessor, but this can cause problems in dead loops because forward references can be created, leading to issues with optimization passes that look at all code, dead or not. This addresses issue JuliaLang#29107 when DCE is turned on.
Phi nodes are optimized away when there is only one predecessor, but this can cause problems in dead loops because forward references can be created, leading to issues with optimization passes that look at all code, dead or not. This addresses issue JuliaLang#29107 when DCE is turned on.
Phi nodes are optimized away when there is only one predecessor, but this can cause problems in dead loops because forward references can be created, leading to issues with optimization passes that look at all code, dead or not. This addresses issue JuliaLang#29107 when DCE is turned on.
Phi nodes are optimized away when there is only one predecessor, but this can cause problems in dead loops because forward references can be created, leading to issues with optimization passes that look at all code, dead or not. This addresses issue JuliaLang#29107 when DCE is turned on.
Phi nodes are optimized away when there is only one predecessor, but this can cause problems in dead loops because forward references can be created, leading to issues with optimization passes that look at all code, dead or not. This fixes issue JuliaLang#29107 when DCE is turned on.
Phi nodes are optimized away when there is only one predecessor, but this can cause problems in dead loops because forward references can be created, leading to issues with optimization passes that look at all code, dead or not. This fixes issue JuliaLang#29107 when DCE is turned on.
Phi nodes are optimized away when there is only one predecessor, but this can cause problems in dead loops because forward references can be created, leading to issues with optimization passes that look at all code, dead or not. This fixes issue JuliaLang#29107 when DCE is turned on.
Phi nodes are optimized away when there is only one predecessor, but this can cause problems in dead loops because forward references can be created, leading to issues with optimization passes that look at all code, dead or not. This fixes issue JuliaLang#29107 when DCE is turned on.
Phi nodes are optimized away when there is only one predecessor, but this can cause problems in dead loops because forward references can be created, leading to issues with optimization passes that look at all code, dead or not. This fixes issue JuliaLang#29107 when DCE is turned on.
Phi nodes are optimized away when there is only one predecessor, but this can cause problems in dead loops because forward references can be created, leading to issues with optimization passes that look at all code, dead or not. This fixes issue #29107 when DCE is turned on.
Phi nodes are optimized away when there is only one predecessor, but this can cause problems in dead loops because forward references can be created, leading to issues with optimization passes that look at all code, dead or not. This fixes issue JuliaLang#29107 when DCE is turned on.
Phi nodes are optimized away when there is only one predecessor, but this can cause problems in dead loops because forward references can be created, leading to issues with optimization passes that look at all code, dead or not. This fixes issue #29107 when DCE is turned on.
Last night's nanosolider run showed regressions in the
perf_sumvector
benchmarks. Running those locally, we see that they in fact trigger a compiler error:The text was updated successfully, but these errors were encountered: