-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
Speed up iteration with numbers #16687
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
Conversation
Might this be a regression? It doesn't happen in v0.4.5. |
Yes, this appears to be an LLM regression since it also doesn't happen with llvm 3.3 on master |
How does one go about reporting such things upstream? I'm presuming that a few lines of Julia code that demonstrate the problem won't quite cut it. Since the code returned by |
Run it with |
Usually upstream wants a .ll file: Which you can then test outside of julia with |
Thanks for the great tips. I wrote the Examples:
I posted a gist with I'm sure I'm being a noob about this, so apologies in advance. But I'm also wondering, are we certain this issue is purely an LLVM issue? Or is there some pass I have to turn on explicitly in |
This needs to be debugged and isolated a bit more. |
I agree, I'll file an issue. But it's too separate, with too simple of a workaround, to let it derail my current task. |
yeah that's fine. workaround was simple in this case that you noticed, but how much other code might be affected by the same underlying problem? |
I'm not disagreeing in the slightest (it's much of why I filed the issue). |
While tracking down a puzzling performance regression with #16260, I discovered that LLVM is remarkably sensitive to how we define
start
,next
, anddone
for iteration over scalars. Here's how I discovered the problem:Results:
Now, this dramatic difference simply indicates that LLVM is eliding the inner loop for
iter_indexed
but not foriter_in
:Based on this, it's worth testing two ways of declaring iteration over a number:
with results