-
-
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
optimizer bug on ind2sub #7197
Comments
This PR does: - fix a bug in getindex_general. Indexing with a disordered array lead to a no-methods error. Test added - temprary fix for JuliaLang#7197 in `test/sparse.jl` - added performance tests for Sparse-uint matrices
Seems to be a problem with the begin
S = [1 2 3; 4 5 6; 7 8 9]
println(ind2sub(size(S), 5));
@test S[1] == 1
end works. Thus work around for sparse-test in above PR. |
This PR does: - fix a bug in getindex_general. Indexing with a disordered array lead to a no-methods error. Test added - temprary fix for JuliaLang#7197 in `test/sparse.jl` - added performance tests for Sparse-uint matrices
Reduced case:
Even worse, turning off LLVM optimizations fixes it.
and the optimizer changes this to
It looks like |
Seems to work fine on LLVM 3.5 |
What do we do for the 0.3 release? |
One of,
|
Of course there's still the issue of distributions including vanilla 3.3 |
Is it possible that a particular optimizer pass is doing it, and we can disable it? |
Found it. Here's the llvm commit that fixed it:
I'm inclined to include this patch. The culprit is the InstructionCombining pass. We could remove all uses of it when not using our own llvm; the performance difference seems to be fairly small. |
Cc: @ArchRobison |
Do we just use |
Will that patch actually be applied for people that just |
I'm not going to be able to fix the system LLVM in Fedora, so if you want this to be fixed in distro packages it would be good to find a workaround in Julia until it is ported to LLVM 3.5. |
Yes I am just using We do have a workaround; certain optimization passes can be disabled. However the patch currently causes a mysterious test failure on travis. |
I like the suggestion of patching an LLVM header file with a |
fix #7197, backport a fix to SimplifyDemandedUseBits in LLVM
So does this require a |
I find the following works with minimal rebuild time:
|
For the record, the clean-llvm thing worked too but took a while. |
Jeff's practice of tagging new tests with their issue numbers is awesome. In this case, it helped me answer "why doesn't Julia pass its tests, and how do I fix it?" in 30s flat. |
That is a really effective and useful practice. |
@ihnorton this test is failing in the Windows binaries, can you make sure the LLVM patch gets applied next rebuild? cheers |
This is incorrect. Surprisingly, not using
@test
gives the correct result:I'm on:
The text was updated successfully, but these errors were encountered: