-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Move creation of mpm to optimize_final_module #9670
Conversation
Thanks for the patch @yashssh. Please could you add a release note to accompany this patch (instructions are here along with examples from other PRs in the directory above: numba/docs/upcoming_changes/README.rst Lines 1 to 47 in f3665c4
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the patch and for investigating this @yashssh, there's a few minor things to resolve else looks good. It's great to see this issue fixed.
numba/tests/test_override.py
Outdated
instrs = [x for x in block.instructions if x.opcode != 'call'] | ||
op_expect = {'fadd', 'fmul', 'fdiv'} | ||
started = False | ||
for x in instrs: | ||
if x.opcode in op_expect: | ||
op_expect.remove(x.opcode) | ||
if not started: | ||
started = True | ||
elif op_expect and started: | ||
break | ||
|
||
self.assertGreater(len(op_expect), 0, | ||
"Function was optimized unexpectedly") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've verified this manually against the IR produced on main
and the IR produced with this PR. The IR produced when using this PR contains load
s and store
s interleaved with the fadd
, fmul
and fdiv
instructions, whereas on main
these loads and stores are optimised out and the arithmetic instructions appear sequentially.
Co-authored-by: stuartarchibald <[email protected]>
Thanks for the review @stuartarchibald! I have added the release notes and addressed the comments. |
I'm just going to close and reopen this to trigger a rebuild on RTD now that #9675 resolved the issue. |
Are you suggesting to rebase my branch on top of main? |
I suggest merging |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The merge from main
looks good.
Fixes #9646