Skip to content
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

[LLVM] add patches for JuliaLang/julia#36062 #1318

Merged
merged 1 commit into from
Jul 18, 2020
Merged

Conversation

vchuravy
Copy link
Member

No description provided.

@vchuravy
Copy link
Member Author

@yuyichao should these be backported to LLVM 8?

@vchuravy vchuravy mentioned this pull request Jul 18, 2020
5 tasks
@yuyichao
Copy link

I believe these two should be although I didn't test on LLVM 8 or 9 to see if they needs to.
Both changes, especially the "backport" of https://reviews.llvm.org/D80101 for stack coloring, should pass another pair of eyes... The change to CodeGenPrepare should be pretty safe and will hopefully have reviews from https://reviews.llvm.org/D84031.................

Also note that these two changes aren't related to JuliaLang/julia#36062, they are the two other bugs that I hit when debugging it (actually I hit them only after working around JuliaLang/julia#36062 via JuliaLang/julia#36705 ....).

JuliaLang/julia#36062, which is also the only bug that is easily reprodicible without assertion on and without additional verification passes, is caused by lsr. The instruction is introduced in the pass at https://github.com/llvm/llvm-project/blob/076e08aa4501f682c43e71a8fed1e12da485abc7/llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp#L5277. AFAICT it may require some "non-local" changes to either change the decision about doing the transformation or change the code pattern it wants to emit...

FWIW, since this is in codegen preparation, it's probably fixable if we simply strip out the address space or remove the NI from the datalayout.

@vchuravy
Copy link
Member Author

vchuravy commented Jul 18, 2020

FWIW, since this is in codegen preparation, it's probably fixable if we simply strip out the address space or remove the NI from the datalayout.

So we could run the RemoveAddrspacesPass (https://github.com/JuliaLang/julia/blob/6a4793ae77490c7704967acb996902661279396e/src/llvm-remove-addrspaces.cpp) instead of disabling LSR?

@yuyichao
Copy link

yuyichao commented Jul 18, 2020

So we could run the RemoveAddrspacesPass (https://github.com/JuliaLang/julia/blob/master/src/llvm-remove-addrspaces.cpp) instead of disabling LSR?

Yes, that might be the case. I'm also testing if we can just change the datalayout since it'll be cheaper. Is that legal (to do in a pass)?

@yuyichao
Copy link

It passes initial testing... so I'll do a more complete test to see if it passes full compilation...

@vchuravy vchuravy merged commit 47518e6 into master Jul 18, 2020
@vchuravy vchuravy deleted the vc/llvm_armppc branch July 18, 2020 17:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants